| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?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="cardNo" column="card_no"/>
- <result property="name" column="name"/>
- <result property="identityId" column="identity_id"/>
- <result property="idCard" column="id_card"/>
- <result property="sexId" column="sex_id"/>
- <result property="headImage" column="department_id"/>
- <result property="headImage" column="head_image"/>
- <result property="headImage" column="grade"/>
- <result property="headImage" column="college"/>
- <result property="headImage" column="speciality"/>
- <result property="headImage" column="school_class"/>
- <result property="headImage" column="campus"/>
- <result property="headImage" column="dormitory_number"/>
- <result property="headImage" column="phone"/>
- <result property="headImage" column="affiliate"/>
- <result property="headImage" column="title"/>
- <result property="headImage" column="address"/>
- <result property="headImage" column="nation"/>
- <result property="headImage" column="of_student"/>
- <result property="headImage" column="graduate"/>
- <result property="headImage" column="duties"/>
- <result property="headImage" column="is_cancel"/>
- </resultMap>
- <select id="querySmartUserPages" resultType="com.template.model.vo.UserVo" resultMap="smartUserPageMap">
- select id,card_no,name,identity_id,id_card,sex_id,department_id,head_image,grade,college,speciality,school_class,campus,dormitory_number,
- phone,affiliate,title,address,nation,of_student,graduate,duties,is_cancel
- 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} '%' or card_no like '%' #{name} '%')
- </if>
- </select>
- <resultMap type="com.template.model.pojo.SmartUser" id="smartUsersMap">
- <result property="cardNo" column="card_no"/>
- <result property="name" column="name"/>
- <result property="identityId" column="identity_id"/>
- <result property="idCard" column="id_card"/>
- <result property="sexId" column="sex_id"/>
- <result property="departmentId" column="department_id"/>
- <result property="headImage" column="head_image"/>
- <result property="grade" column="grade"/>
- <result property="college" column="college"/>
- <result property="speciality" column="speciality"/>
- <result property="schoolClass" column="school_class"/>
- <result property="campus" column="campus"/>
- <result property="dormitoryNumber" column="dormitory_number"/>
- <result property="phone" column="phone"/>
- <result property="affiliate" column="affiliate"/>
- <result property="title" column="title"/>
- <result property="address" column="address"/>
- <result property="nation" column="nation"/>
- <result property="ofStudent" column="of_student"/>
- <result property="graduate" column="graduate"/>
- <result property="duties" column="duties"/>
- </resultMap>
- <select id="querySmartUsers" resultType="com.template.model.pojo.SmartUser" resultMap="smartUsersMap">
- select card_no,name,identity_id,id_card,sex_id,department_id,head_image,grade,college,speciality,school_class,campus,dormitory_number,
- phone,affiliate,title,address,nation,of_student,graduate,duties 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>
- <resultMap type="com.template.model.vo.GradeVo" id="smartSecordUserPageMap">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="grade" column="grade"/>
- <result property="schoolClass" column="school_class"/>
- <result property="cardNo" column="card_no"/>
- </resultMap>
- <select id="querySmartSecordPage" resultType="com.template.model.vo.GradeVo" resultMap="smartSecordUserPageMap">
- select id,name,grade,school_class,card_no from smart_user
- where deleted = 0 and is_cancel = 0 and identity_id = 2
- <if test="name != null and name != ''">
- and name like '%' #{name} '%'
- </if>
- </select>
- </mapper>
|