<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.zy.asrs.mapper.WrkMastStaMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMastSta">
|
<id column="ID" property="id" />
|
<result column="WRK_NO" property="wrkNo" />
|
<result column="WRK_START" property="wrkStart" />
|
<result column="WRK_END" property="wrkEnd" />
|
<result column="STA_START" property="staStart" />
|
<result column="STA_END" property="staEnd" />
|
<result column="CREATE_TIME" property="createTime" />
|
<result column="UPDATE_TIME" property="updateTime" />
|
<result column="TYPE" property="type" />
|
<result column="WRK_STS" property="wrkSts" />
|
<result column="LINE_NUMBER" property="lineNumber" />
|
<result column="WRK_TYPE" property="wrkType" />
|
<result column="WRK_CRN" property="wrkCrn" />
|
<result column="BIGN_TIME" property="bignTime" />
|
|
</resultMap>
|
|
<select id="selectAllWrkMastStaList" resultMap="BaseResultMap">
|
select * from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
and WRK_STS=0
|
<if test="type!=null">
|
and TYPE = #{type}
|
</if>
|
order by LINE_NUMBER,ID
|
</select>
|
|
<select id="selectByWrkNo" resultMap="BaseResultMap">
|
select top 1 * from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
and WRK_NO = #{workNo}
|
</select>
|
|
<select id="selectNoInterfere" resultMap="BaseResultMap">
|
select top 1 * from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
and (STA_START in
|
<foreach item="item" collection="staStarts" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
or STA_START = 0
|
)
|
and (STA_END in
|
<foreach item="item" collection="staEnds" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
or STA_END = 0
|
)
|
and WRK_STS=0
|
order by LINE_NUMBER,ID
|
</select>
|
|
<select id="selectNoInterfereList" resultMap="BaseResultMap">
|
select * from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
and (STA_START in
|
<foreach item="item" collection="staStarts" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
or STA_START = 0
|
)
|
and (STA_END in
|
<foreach item="item" collection="staEnds" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
or STA_END = 0
|
)
|
and WRK_STS=0
|
order by LINE_NUMBER,ID
|
</select>
|
|
<select id="selectAllWrkCount" resultType="Integer">
|
select count(1) from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
<if test="type!=null">
|
and TYPE = #{type}
|
</if>
|
</select>
|
|
<select id="selectAllWrkCount108" resultType="Integer">
|
select count(1) from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
and TYPE = 1
|
and (STA_END = 108 or STA_START = 108)
|
</select>
|
|
<select id="selectAllWrkCount108Y" resultType="Integer">
|
select count(1) from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
-- and type = 1
|
and ((STA_END <= 108 or STA_START <= 108)
|
or (STA_END = 118 or STA_START = 118)
|
or (STA_END = 122 or STA_START = 122))
|
</select>
|
|
<select id="selectAllWrkStsCount" resultType="Integer">
|
select count(1) from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
<if test="type!=null">
|
and TYPE = #{type}
|
</if>
|
<if test="wrkSts!=null">
|
and WRK_STS = #{wrkSts}
|
</if>
|
</select>
|
|
<select id="selectAllWrkStsCountWrkMastSta" resultMap="BaseResultMap">
|
select top 1 * from "SOURCE"."asr_wrk_mast_sta"
|
where 1=1
|
<if test="type!=null">
|
and TYPE = #{type}
|
</if>
|
<if test="wrkSts!=null">
|
and WRK_STS = #{wrkSts}
|
</if>
|
</select>
|
|
|
|
|
</mapper>
|