| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?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.ydtech.modules.admin.dao.SysRelationPersonMapper">
- <resultMap type="com.ydtech.modules.admin.model.SysRelationPerson" id="SysRelationPersonMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="agencyLeaderId" column="agency_leader_id" jdbcType="VARCHAR"/>
- <result property="suggestId" column="suggest_id" jdbcType="VARCHAR"/>
- <result property="source" column="source" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
- <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
- </resultMap>
- <select id="getByUserIdList" resultType="com.ydtech.modules.admin.model.SysRelationPerson">
- select *
- from sys_relation_person a
- <where>
- 1=1
- <if test="userIds != null and userIds != '' and userIds.size() > 0">
- and a.agency_leader_id in
- <foreach collection="userIds" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <select id="getByAgencyLeaderId" resultType="com.ydtech.modules.admin.model.SysRelationPerson">
- select *
- from sys_relation_person a
- <where>
- 1=1
- and a.del_flag ='1'
- and a.type ='1'
- <if test="userId != null and userId !=''">
- and a.agency_leader_id =#{userId}
- </if>
- </where>
- </select>
- <select id="getBySuggestId" resultType="com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto">
- select
- a.agency_leader_id as "userId",
- su.name as "userName"
- from sys_relation_person a
- left join sys_user su on su.id = a.agency_leader_id
- <where>
- 1=1
- and a.del_flag ='1'
- and a.source ='0'
- and a.type ='0'
- <if test="vo.userId != null and vo.userId !=''">
- and a.suggest_id =#{vo.userId}
- </if>
- <if test="vo.type != null and vo.type !=''">
- and a.type =#{vo.type}
- </if>
- </where>
- </select>
- <select id="selectListByLeaderId" resultType="com.ydtech.modules.admin.model.SysAgencyLeader">
- select
- sal.*
- from sys_relation_person a
- left join sys_user su on su.id = a.agency_leader_id
- left join sys_agency_leader sal on a.agency_leader_id = sal.user_id
- where
- a.suggest_id =#{userId}
- and a.type =#{type}
- </select>
- </mapper>
|