*
L
2026-01-23 4d9e2ea59aa2e9fbdcacd3d8d8dfd543a2fccba5
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
@@ -57,6 +63,16 @@
        and "WRK_NO"=#{workNo}
        and "START_POINT"=#{startPoint}
        and "IO_TYPE"=1
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectPakInDemo" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."wcs_task_wrk"
        where "WRK_STS"=2
          and "CRN_NO"=#{crnNo}
          and "WRK_NO"=#{workNo}
          and "ORIGIN_START_POINT"=#{startPoint}
          and "IO_TYPE"=4
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
@@ -82,6 +98,15 @@
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectCrnStaWorkingDemo" resultMap="BaseResultMap">
        select * from "SOURCE"."wcs_task_wrk"
        where "CRN_NO"=#{crnNo}
          and "ORIGIN_TARGET_POINT"=#{targetPoint}
          and "WRK_STS"=13
          and "IO_TYPE" = 4
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectPakOut" resultMap="BaseResultMap">
        select * from "SOURCE"."wcs_task_wrk"
        where "CRN_NO"=#{crnNo}
@@ -90,6 +115,17 @@
        </if>
        and "WRK_STS"=11
        and "IO_TYPE" = 2
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectPakOutDemo" resultMap="BaseResultMap">
        select * from "SOURCE"."wcs_task_wrk"
        where "CRN_NO"=#{crnNo}
        <if test="targetPoint!=null and targetPoint!='' ">
            and "ORIGIN_TARGET_POINT"=#{targetPoint}
        </if>
        and "WRK_STS"=11
        and "IO_TYPE" = 4
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
@@ -119,11 +155,21 @@
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectCrnNoInWorkingDemo" resultMap="BaseResultMap">
        select top 1 * from "SOURCE"."wcs_task_wrk"
        where 1=1
          and "IO_TYPE"=4
          and ("WRK_STS"=3 or "WRK_STS"=12)
          and "CRN_NO"=#{crnNo}
          and "WRK_NO"=#{workNo}
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
    <select id="selectToBeHistoryData" resultMap="BaseResultMap">
        select * from "SOURCE"."wcs_task_wrk"
        where 1=1
        and (("WRK_STS"=14 and "STATUS"=5) or "STATUS"=7 or "STATUS"=4
                 or ("WRK_STS"=4 and "STATUS"=5) or ("WRK_STS"=14 and "STATUS"=9))
                 or ("WRK_STS"=4 and "STATUS"=5) or ("IO_TYPE"=4 and "WRK_STS"=4 and "STATUS"=5))
        order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
    </select>
@@ -132,7 +178,6 @@
        select * from "SOURCE"."wcs_task_wrk"
        where "TASK_NO" = #{taskNo}
          and ("STATUS"=5 or "STATUS"=4 or "STATUS"=7)
        and ("WRK_NO" not in (select "WRK_NO" from "SOURCE"."asr_bas_devp"))
    </insert>
    <insert id="saveToHistoryD">
@@ -156,11 +201,38 @@
        <if test="status != null">
            and STATUS = #{status}
        </if>
        <if test="barcode != null">
            and BARCODE = #{barcode}
        </if>
        <if test="startPoint != null">
            and (
            START_POINT = #{startPoint}
            or ORIGIN_START_POINT = #{startPoint}
            )
        </if>
        <if test="targetPoint != null">
            and (
            TARGET_POINT = #{targetPoint}
            or ORIGIN_TARGET_POINT = #{targetPoint}
            )
        </if>
        <if test="modiTimeStart != null ">
            <if test="modiTimeEnd != null ">
                and MODI_TIME between #{modiTimeStart} and #{modiTimeEnd}
            </if>
        </if>
        <if test="allField != null and allField != ''">
            <bind name="searchPattern" value="'%' + allField + '%'" />
            and (
            WRK_NO LIKE #{searchPattern}
            or TASK_NO LIKE #{searchPattern}
            or BARCODE LIKE #{searchPattern}
            or START_POINT LIKE #{searchPattern}
            or TARGET_POINT LIKE #{searchPattern}
            or ORIGIN_START_POINT LIKE #{searchPattern}
            or ORIGIN_TARGET_POINT LIKE #{searchPattern}
            )
        </if>
    </sql>