SmartUserMapper.xml 922 B

1234567891011121314151617181920
  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. <result property="departmentId" column="department_id"/>
  9. </resultMap>
  10. <select id="queryAffiliateUserById" resultType="com.template.model.vo.AffiliateUserVo" resultMap="affiliateUserMap">
  11. select id,name,card_no,department_id from smart_user
  12. where find_in_set(id,(select affiliate from smart_user where
  13. deleted = 0
  14. <if test="id != null and id != ''">
  15. and id = #{id}
  16. </if>
  17. )) and deleted = 0
  18. </select>
  19. </mapper>