| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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.zhongzheng.modules.distribution.mapper.DistributionSellerMapper">
- <resultMap type="com.zhongzheng.modules.distribution.domain.DistributionSeller" id="DistributionSellerResult">
- <result property="sellerId" column="seller_id"/>
- <result property="realname" column="realname"/>
- <result property="status" column="status"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="userAccount" column="user_account"/>
- <result property="gzhOpenId" column="gzh_open_id"/>
- <result property="unionId" column="union_id"/>
- <result property="parentId" column="parent_id"/>
- <result property="shareCode" column="share_code"/>
- <result property="registerFrom" column="register_from"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.distribution.vo.DistributionSellerVo" id="DistributionSellerVoResult">
- <result property="sellerId" column="seller_id"/>
- <result property="realname" column="realname"/>
- <result property="status" column="status"/>
- <result property="userAccount" column="user_account"/>
- <result property="gzhOpenId" column="gzh_open_id"/>
- <result property="unionId" column="union_id"/>
- <result property="parentId" column="parent_id"/>
- <result property="shareCode" column="share_code"/>
- <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
- <result property="phonenumber" column="phonenumber"/>
- <result property="avatar" column="avatar"/>
- <result property="cash" column="cash"/>
- <result property="usedCash" column="used_cash"/>
- <result property="freezeCash" column="freeze_cash"/>
- </resultMap>
- <select id="getSellerListByTenant" parameterType="com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery" resultType="com.zhongzheng.modules.distribution.vo.DistributionSellerVo">
- SELECT ds.*,sr.realname,sr.user_account,t.tenant_name,
- (SELECT COUNT(*) FROM distribution_seller dr WHERE dr.parent_id = ds.seller_id) promotionNum
- FROM `distribution_seller` ds
- LEFT JOIN distribution_seller sr ON ds.parent_id = sr.seller_id
- LEFT JOIN sys_tenant t ON ds.tenant_id = t.tenant_id
- WHERE 1 = 1
- <if test="tenantId != null and tenantId != ''">
- AND ds.tenant_id = #{tenantId}
- </if>
- <if test="parentName != null and parentName != ''">
- AND sr.realname = #{parentName}
- </if>
- <if test="realname != null and realname != ''">
- AND ds.realname = #{realname}
- </if>
- </select>
- <select id="findList" parameterType="com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery" resultMap="DistributionSellerVoResult">
- SELECT
- s.*,
- u.id_card,
- u.phonenumber
- FROM
- distribution_seller s
- LEFT JOIN sys_user u ON s.seller_id = u.seller_id
- ORDER BY
- s.seller_id DESC
- </select>
- <select id="findDetail" parameterType="Long" resultMap="DistributionSellerVoResult">
- SELECT
- s.*,
- u.id_card,
- u.phonenumber,
- u.avatar
- FROM
- distribution_seller s
- LEFT JOIN sys_user u ON s.seller_id = u.seller_id
- WHERE s.seller_id = #{sellerId}
- </select>
- </mapper>
|