| | |
| | | t3.sleep_start_date, |
| | | t3.sleep_end_date, |
| | | t3.is_day_span, |
| | | t4.equipment_name, |
| | | t4.equipment_id |
| | | t4.equipment_name |
| | | FROM |
| | | mdc_device_calendar t1 |
| | | LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id |
| | | LEFT JOIN mdc_shift_sub t3 ON t1.shift_sub_id = t3.id |
| | | LEFT JOIN mdc_equipment t4 ON t1.equment_id = t4.equipment_id |
| | | LEFT JOIN mdc_equipment t4 ON t1.equipment_id = t4.equipment_id |
| | | WHERE 1=1 |
| | | <if test="deviceCalendar.effectiveDate != null and deviceCalendar.effectiveDate != ''"> |
| | | AND t1.effective_date LIKE CONCAT('%',#{ deviceCalendar.effectiveDate },'%') |
| | | </if> |
| | | <if test="deviceCalendar.equipmentId != null and deviceCalendar.equipmentId != ''"> |
| | | AND t1.equment_id = #{ deviceCalendar.equipmentId } |
| | | AND t1.equipment_id = #{ deviceCalendar.equipmentId } |
| | | </if> |
| | | <if test="deviceCalendar.startTime != null and deviceCalendar.startTime != ''"> |
| | | AND t1.effective_date >= #{ deviceCalendar.startTime } |
| | |
| | | AND t1.effective_date <= #{ deviceCalendar.endTime } |
| | | </if> |
| | | <if test="deviceCalendar.equipmentIdList != null and deviceCalendar.equipmentIdList.size() > 0 "> |
| | | AND t1.equment_id IN |
| | | AND t1.equipment_id IN |
| | | <foreach collection="deviceCalendar.equipmentIdList" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | |
| | | ORDER BY t4.equipment_name ASC, t1.EFFECTIVE_DATE ASC |
| | | </select> |
| | | |
| | | |
| | | <select id="listByEquipmentAndDate" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo"> |
| | | SELECT |
| | | t1.*, |
| | | t2.shift_name, |
| | | t3.shift_sub_name, |
| | | t3.start_date, |
| | | t3.end_date, |
| | | t3.sleep_start_date, |
| | | t3.sleep_end_date, |
| | | t3.is_day_span, |
| | | t4.equipment_name |
| | | FROM |
| | | mdc_device_calendar t1 |
| | | LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id |
| | | LEFT JOIN mdc_shift_sub t3 ON t1.shift_sub_id = t3.id |
| | | LEFT JOIN mdc_equipment t4 ON t1.equipment_id = t4.equipment_id |
| | | <where> |
| | | <if test="equipmentId != null and equipmentId != ''"> |
| | | AND t4.equipment_id = #{ equipmentId } |
| | | </if> |
| | | <if test="stringDate != null and stringDate != ''"> |
| | | AND t1.effective_date = #{ stringDate } |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="findAcquiesceShift" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo"> |
| | | SELECT |
| | | t1.id shiftId, |
| | | t2.id shiftSubId, |
| | | t1.shift_name shiftName, |
| | | t2.shift_sub_name shiftSubName, |
| | | t2.start_date startDate, |
| | | t2.end_date endDate, |
| | | t2.sleep_start_date sleepStartDate, |
| | | t2.sleep_end_date sleepEndDate, |
| | | t2.is_day_span isDaySpan |
| | | FROM |
| | | mdc_shift t1 LEFT JOIN mdc_shift_sub t2 ON t2.shift_id = t1.id |
| | | WHERE t1.default_shift = 'true' |
| | | </select> |
| | | |
| | | </mapper> |