RepairClassesSettingsMapper.xml 1.6 KB

12345678910111213141516171819202122232425262728293031
  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.repair.mapper.RepairClassesSettingsMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.repair.model.vo.ClassesSettingVo" id="repairClassesListMap">
  6. <result property="id" column="id"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="userName" column="user_name"/>
  9. <result property="startDate" column="start_date"/>
  10. <result property="shiftId" column="shift_id"/>
  11. <result property="shiftName" column="shift_name"/>
  12. </resultMap>
  13. <select id="queryClassesSettingList" resultType="com.repair.model.vo.ClassesSettingVo" resultMap="repairClassesListMap">
  14. 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
  15. FROM repair_classes_settings rcs
  16. <where>
  17. and rcs.deleted = 0
  18. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  19. and rcs.start_date BETWEEN #{startTime} and #{endTime}
  20. </if>
  21. <if test="userIds != null and userIds.size() > 0">
  22. and rcs.user_id in
  23. <foreach collection="userIds" item="userId" index="index" open="(" close=")" separator=",">
  24. ${userId}
  25. </foreach>
  26. </if>
  27. </where>
  28. </select>
  29. </mapper>