*
lsh
2025-10-21 712dcbef9f4ae3f81e751bf8651d2e241f3f792c
src/main/resources/mapper/TaskWrkMapper.xml
@@ -36,6 +36,12 @@
        and "TASK_NO" = #{taskNo}
    </select>
    <select id="selectByLaneNo" resultMap="BaseResultMap">
        select * from "SOURCE"."wcs_task_wrk"
        where 1=1
          and "CRN_NO"=#{crnNo}
    </select>
    <select id="selectByStartPoint" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."wcs_task_wrk"
        where 1=1
@@ -52,6 +58,7 @@
    <select id="selectPakIn" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."wcs_task_wrk"
        where "STATUS"=1
        and "WRK_STS"=2
        and "CRN_NO"=#{crnNo}
        and "WRK_NO"=#{workNo}
        and "START_POINT"=#{startPoint}
@@ -130,7 +137,11 @@
        insert into "SOURCE"."wcs_task_wrk_log"
        select * from "SOURCE"."wcs_task_wrk"
        where "TASK_NO" = #{taskNo}
          and ("STATUS"=5 or "STATUS"=4 or "STATUS"=6)
          and ("STATUS"=5 or "STATUS"=4 or "STATUS"=7)
    </insert>
    <insert id="saveToHistoryD">
        insert into "SOURCE"."wcs_task_wrk_log" select * from "SOURCE"."wcs_task_wrk" where TASK_NO = #{taskNo}
    </insert>
    <select id="selectWorkingTask" resultMap="BaseResultMap">
@@ -140,4 +151,36 @@
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <sql id="batchSeq">
        <if test="wrkNo != null">
            and WRK_NO = #{wrkNo}
        </if>
        <if test="taskNo != null">
            and TASK_NO = #{taskNo}
        </if>
        <if test="status != null">
            and STATUS = #{status}
        </if>
        <if test="modiTimeStart != null ">
            <if test="modiTimeEnd != null ">
                and MODI_TIME between #{modiTimeStart} and #{modiTimeEnd}
            </if>
        </if>
    </sql>
    <select id="selectTaskWrkList" resultMap="BaseResultMap">
        SELECT * FROM "SOURCE"."wcs_task_wrk"
        WHERE 1=1
        <include refid="batchSeq"></include>
        ORDER BY CREATE_TIME DESC
        LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize});
    </select>
    <select id="selectTaskWrkListTotal" resultType="Long">
        SELECT count(1) FROM "SOURCE"."wcs_task_wrk"
        WHERE 1=1
        <include refid="batchSeq"></include>
    </select>
</mapper>