| 123456789101112131415161718192021222324252627282930313233 |
- <?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.repair.mapper.RepairClassesSettingsMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.repair.model.vo.ClassesSettingVo" id="repairClassesListMap">
- <result property="id" column="id"/>
- <result property="userId" column="user_id"/>
- <result property="userName" column="user_name"/>
- <result property="startDate" column="start_date"/>
- <result property="shiftId" column="shift_id"/>
- <result property="shiftName" column="shift_name"/>
- <result property="shiftColor" column="shift_color"/>
- </resultMap>
- <select id="queryClassesSettingList" resultType="com.repair.model.vo.ClassesSettingVo" resultMap="repairClassesListMap">
- SELECT rcs.id,rcs.user_id,rcs.start_date,rcs.shift_id,(select GROUP_CONCAT(name) from repair_shift_settings where find_in_set(id,rcs.shift_id) and deleted = 0) as shift_name
- ,(select GROUP_CONCAT(color) from repair_shift_settings where find_in_set(id,rcs.shift_id) and deleted = 0) as shift_color
- FROM repair_classes_settings rcs
- <where>
- and rcs.deleted = 0
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- and rcs.start_date BETWEEN #{startTime} and #{endTime}
- </if>
- <if test="userIds != null and userIds.size() > 0">
- and rcs.user_id in
- <foreach collection="userIds" item="userId" index="index" open="(" close=")" separator=",">
- ${userId}
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|