<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jumeirah.common.mapper.MerchantUserMapper">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,mc_id,is_admin, username, nickname, password, salt, phone, phone_area, gender, head, position, state, department_id, role_id, deleted, version, create_time, update_time
    </sql>

    <select id="getMerchantUserById" resultType="com.jumeirah.common.vo.MerchantUserQueryVo">
        select
        <include refid="Base_Column_List"/>
        from merchant_user where id = #{id}
    </select>

    <select id="getMerchantUserPageList" parameterType="com.jumeirah.common.param.MerchantUserPageParam"
            resultType="com.jumeirah.common.vo.MerchantUserQueryVo">
        select
        <include refid="Base_Column_List"/>
        from merchant_user
    </select>

    <select id="getMerchantUserListByMcId" parameterType="com.jumeirah.common.param.MerchantUserPageParam"
            resultType="com.jumeirah.common.vo.MerchantUserQueryVo">

                        select
                        id,mc_id,is_admin, username, nickname, phone, phone_area, gender, head, position, state, role_id, create_time, update_time
                        from merchant_user
                        where mc_id = #{id}
                        and deleted=0

    </select>
</mapper>
