SysRelationPersonMapper.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.ydtech.modules.admin.dao.SysRelationPersonMapper">
  4. <resultMap type="com.ydtech.modules.admin.model.SysRelationPerson" id="SysRelationPersonMap">
  5. <result property="id" column="id" jdbcType="INTEGER"/>
  6. <result property="agencyLeaderId" column="agency_leader_id" jdbcType="VARCHAR"/>
  7. <result property="suggestId" column="suggest_id" jdbcType="VARCHAR"/>
  8. <result property="source" column="source" jdbcType="INTEGER"/>
  9. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  10. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  11. <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
  12. </resultMap>
  13. <select id="getByUserIdList" resultType="com.ydtech.modules.admin.model.SysRelationPerson">
  14. select *
  15. from sys_relation_person a
  16. <where>
  17. 1=1
  18. <if test="userIds != null and userIds != '' and userIds.size() > 0">
  19. and a.agency_leader_id in
  20. <foreach collection="userIds" item="item" open="(" separator="," close=")">
  21. #{item}
  22. </foreach>
  23. </if>
  24. </where>
  25. </select>
  26. <select id="getByAgencyLeaderId" resultType="com.ydtech.modules.admin.model.SysRelationPerson">
  27. select *
  28. from sys_relation_person a
  29. <where>
  30. 1=1
  31. and a.del_flag ='1'
  32. and a.type ='1'
  33. <if test="userId != null and userId !=''">
  34. and a.agency_leader_id =#{userId}
  35. </if>
  36. </where>
  37. </select>
  38. <select id="getBySuggestId" resultType="com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto">
  39. select
  40. a.agency_leader_id as "userId",
  41. su.name as "userName"
  42. from sys_relation_person a
  43. left join sys_user su on su.id = a.agency_leader_id
  44. <where>
  45. 1=1
  46. and a.del_flag ='1'
  47. and a.source ='0'
  48. and a.type ='0'
  49. <if test="vo.userId != null and vo.userId !=''">
  50. and a.suggest_id =#{vo.userId}
  51. </if>
  52. <if test="vo.type != null and vo.type !=''">
  53. and a.type =#{vo.type}
  54. </if>
  55. </where>
  56. </select>
  57. </mapper>