pang.jiabao
2026-01-28 2bd2c83cebc29314c961632bfbbb771d0cc94936
src/main/resources/mapper/WrkMastMapper.xml
@@ -68,20 +68,18 @@
        <result column="work_no_other" property="workNoOther" />
    </resultMap>
    <select id="selectByIoTypeAndWrkSts"  resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where io_type = #{ioType} and wrk_sts = #{wrkSts} order by io_time
    </select>
    <select id="selectInGzxCount" resultType="java.lang.Integer">
        SELECT
            count(DISTINCT m.wrk_no)
        FROM
            asr_wrk_mast m
                LEFT JOIN asr_bas_devp d ON
                m.wrk_no = d.wrk_no
        WHERE
            (m.wrk_sts IN (2, 9 ,10,14)
                AND m.sta_no = #{site}
                AND d.wrk_no IS NOT NULL)
           OR (m.wrk_sts IN(10,11,12,14)
            AND m.sta_no = #{site}
            AND d.wrk_no IS NULL)
       select
        count(*)
       from
        asr_wrk_mast m
       where
        m.sta_no = #{site}
      and (m.whs_type is null or EXISTS (select 1 from asr_bas_devp d where d.wrk_no = m.wrk_no))
    </select>
    <select id="selectByLocNo"  resultMap="BaseResultMap">
@@ -217,4 +215,29 @@
    <select id="selectBy104" resultType="com.zy.entity.WrkMast">
        select top 1 * from asr_wrk_mast awm where awm.sta_no = 104 and awm.wrk_sts = 11 order by awm.appe_time
    </select>
    <select id="selectCountByKb" resultType="java.lang.Integer">
SELECT
   count(*)
FROM
   asr_wrk_mast w
WHERE
   (w.sta_no = 1031
      AND w.wrk_sts != 11
      AND w.wrk_sts != 15)
   OR (
    w.wrk_sts = 15
      AND EXISTS (
      SELECT
         1
      FROM
         asr_bas_devp d
      WHERE
         d.wrk_no = w.wrk_no
         AND d.dev_no IN (1031, 1032, 1033)
    )
)
    </select>
    <select id="selectCountHisByIoTypeAndIoTime" resultType="java.lang.Integer">
         select count (*) from asr_wrk_mast_log where io_type = #{ioType} and io_time = #{ioTime}
    </select>
</mapper>