Lius
2025-08-25 2b9ff0c274a847af41b2f5a04de1b23ed6fbb9bb
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
@@ -41,33 +41,6 @@
        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,
@@ -82,43 +55,6 @@
        FROM
            mdc_shift t1 LEFT JOIN mdc_shift_sub t2 ON t2.shift_id = t1.id
        WHERE t1.default_shift = 'true'
    </select>
    <!--计算实际班产天数-->
    <select id="computeActualWorkDayCount" resultType="java.lang.String">
        SELECT DISTINCT
            effective_date
        FROM
            mdc_device_calendar
        WHERE
            effective_date LIKE CONCAT(#{ validDate }, '%')
            AND equipment_id = #{ equipmentId }
    </select>
    <!--查询班次分类-->
    <select id="findShiftSort" resultType="java.lang.String">
        SELECT DISTINCT
            t2.shift_name
        FROM
            mdc_device_calendar t1 LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id
        WHERE
            t1.effective_date LIKE CONCAT(#{ validDate }, '%')
            AND t1.equipment_id = #{ equipmentId }
    </select>
    <!--查询班次数量-->
    <select id="computeShiftTimeCount" resultType="java.lang.Integer">
        SELECT
            COUNT(*)
        FROM
            mdc_device_calendar
        WHERE
            effective_date LIKE CONCAT(#{ validDate }, '%')
            AND equipment_id = #{ equipmentId }
    </select>
    <select id="getFirstData" resultType="org.jeecg.modules.mdc.entity.MdcDeviceCalendar">
        SELECT TOP 1 * FROM mdc_device_calendar WHERE equipment_id = #{ equipmentId } ORDER BY effective_date ASC
    </select>
    <select id="listByEquipmentAndDates" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo">