<?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="org.jeecg.modules.mdc.mapper.MdcEquipmentRepairMapper">
|
|
<!-- 根据车间层级查询设备维修列表 -->
|
<select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRepair">
|
SELECT
|
*
|
FROM
|
mdc_equipment_repair
|
WHERE 1=1
|
<if test="repair.equipmentName != null and repair.equipmentName != '' ">
|
AND equipment_name LIKE '%' + #{repair.equipmentName} + '%'
|
</if>
|
<if test="repair.equipmentId != null and repair.equipmentId != '' ">
|
AND equipment_id LIKE '%' + #{repair.equipmentId} + '%'
|
</if>
|
<if test="repair.startTime != null ">
|
AND end_time >= #{ repair.startTime }
|
</if>
|
<if test="repair.endTime != null ">
|
AND start_time <= #{ repair.endTime }
|
</if>
|
<if test="repair.mdcSectionIds != null and repair.mdcSectionIds.size() > 0 ">
|
AND equipment_id IN
|
<foreach collection="repair.mdcSectionIds" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
</if>
|
ORDER BY start_time ASC,equipment_id ASC
|
</select>
|
|
<!--查询某段时间内是否有维修休班数据-->
|
<select id="selectByIdAndTime" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRepair">
|
SELECT
|
*
|
FROM
|
mdc_equipment_repair
|
<where>
|
<if test="equipmentId != null and equipmentId!= ''">
|
AND equipment_id = #{ equipmentId }
|
</if>
|
<if test="startTime != null and endTime!= null">
|
AND (
|
( START_TIME <![CDATA[ >= ]]> #{ startTime } AND START_TIME <![CDATA[ <= ]]> #{ endTime } )
|
OR ( START_TIME <![CDATA[ <= ]]> #{ startTime } AND END_TIME <![CDATA[ >= ]]> #{ endTime })
|
OR ( END_TIME <![CDATA[ >= ]]> #{ startTime } AND END_TIME <![CDATA[ <= ]]> #{ endTime } )
|
OR ( START_TIME <![CDATA[ <= ]]> #{ startTime } AND END_TIME <![CDATA[ >= ]]> #{ endTime } )
|
)
|
</if>
|
</where>
|
ORDER BY start_time ASC
|
</select>
|
|
</mapper>
|