SystemUserMapper.xml 843 B

12345678910111213141516171819
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.template.mapper.SmartUserMapper">
  4. <resultMap type="com.template.model.vo.AffiliateUserVo" id="affiliateUserMap">
  5. <result property="id" column="id"/>
  6. <result property="name" column="name"/>
  7. <result property="cardNo" column="card_no"/>
  8. </resultMap>
  9. <select id="queryAffiliateUserById" resultType="com.template.model.vo.AffiliateUserVo" resultMap="affiliateUserMap">
  10. select id,name,card_no from smart_user
  11. where find_in_set(id,(select affiliate from smart_user where
  12. deleted = 0
  13. <if test="id != null and id != ''">
  14. and id = #{id}
  15. </if>
  16. )) and deleted = 0
  17. </select>
  18. </mapper>