lius
2023-07-25 c45790a3da8fa480091be24e0775e9f8dbab927c
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
@@ -42,4 +42,48 @@
        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,
            t4.equipment_id
        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
        <where>
            <if test="equipmentid != null and equipmentid != ''">
                AND t4.equment_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.shift_id shiftId,
            t2.shift_sub_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 t1.shift_sub_id = t2.id
        WHERE t1.default_shift = 'true'
    </select>
</mapper>