<?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="bign_time" property="bignTime" /> 
 | 
  
 | 
    </resultMap> 
 | 
  
 | 
    <select id="selectAllWrkMastStaList" resultMap="BaseResultMap"> 
 | 
        select * from 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 asr_wrk_mast_sta 
 | 
        where 1=1 
 | 
        and wrk_no = #{wrkNo} 
 | 
    </select> 
 | 
  
 | 
    <select id="selectNoInterfere" resultMap="BaseResultMap"> 
 | 
        select top 1 * from 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 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="java.lang.Integer"> 
 | 
        select count(1) from asr_wrk_mast_sta 
 | 
        where 1=1 
 | 
        <if test="type!=null"> 
 | 
            and type = #{type} 
 | 
        </if> 
 | 
    </select> 
 | 
  
 | 
    <select id="selectAllWrkStsCount" resultType="java.lang.Integer"> 
 | 
        select count(1) from 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> 
 |