Lius
2024-12-02 2dcd7f3634f2e636e10ea758441ded77e1d2c845
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcPlanCloseMapper.xml
@@ -2,4 +2,35 @@
<!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.MdcPlanCloseMapper">
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcPlanClose">
        SELECT
            *
        FROM
            mdc_plan_close
        <where>
            <if test="mdcPlanClose.equipmentId != null and mdcPlanClose.equipmentId != ''">
                AND equipment_id = #{ mdcPlanClose.equipmentId }
            </if>
            <if test="mdcPlanClose.planCloseType != null and mdcPlanClose.planCloseType != ''">
                AND plan_close_type = #{ mdcPlanClose.planCloseType }
            </if>
            <if test="mdcPlanClose.theDate != null and mdcPlanClose.theDate != ''">
                AND the_date LIKE CONCAT('%',#{ mdcPlanClose.theDate },'%')
            </if>
            <if test="mdcPlanClose.startTime != null and mdcPlanClose.startTime != ''">
                AND the_date &gt;= #{ mdcPlanClose.startTime }
            </if>
            <if test="mdcPlanClose.endTime != null and mdcPlanClose.endTime != ''">
                AND the_date &lt;= #{mdcPlanClose.endTime }
            </if>
            <if test="mdcPlanClose.equipmentIdList != null and mdcPlanClose.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="mdcPlanClose.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
            AND close_type = #{ mdcPlanClose.closeType }
        </where>
        ORDER BY the_date DESC, equipment_id ASC
    </select>
</mapper>