| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?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.template.mapper.SmartUserMapper">
- <resultMap type="com.template.model.vo.AffiliateUserVo" id="affiliateUserMap">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="cardNo" column="card_no"/>
- <result property="departmentId" column="department_id"/>
- </resultMap>
- <select id="queryAffiliateUserById" resultType="com.template.model.vo.AffiliateUserVo" resultMap="affiliateUserMap">
- select id,name,card_no,department_id from smart_user
- where find_in_set(id,(select affiliate from smart_user where
- deleted = 0
- <if test="id != null and id != ''">
- and id = #{id}
- </if>
- )) and deleted = 0
- </select>
- <resultMap type="com.template.model.vo.UserVo" id="smartUserPageMap">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="cardNo" column="card_no"/>
- <result property="headImage" column="head_image"/>
- </resultMap>
- <select id="querySmartUserPages" resultType="com.template.model.vo.UserVo" resultMap="smartUserPageMap">
- select id,name,card_no,head_image from smart_user
- where deleted = 0 and is_cancel = 0
- <if test="departmentIds != null and departmentIds.size() > 0">
- and department_id in
- <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
- ${departmentId}
- </foreach>
- </if>
- <if test="name != null and name != ''">
- and name like '%' #{name} '%'
- </if>
- </select>
- </mapper>
|