<?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.steerinfo.ems.trmworkproc.mapper.TRmWorkprocMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="STATUS" jdbcType="VARCHAR" property="status" />
    <result column="PARENTID" jdbcType="VARCHAR" property="parentid" />
    <result column="NODE" jdbcType="VARCHAR" property="node" />
    <result column="ENAME" jdbcType="VARCHAR" property="ename" />
    <result column="ALIASNAME" jdbcType="VARCHAR" property="aliasname" />
    <result column="SEQNO" jdbcType="DECIMAL" property="seqno" />
    <result column="ISREAL" jdbcType="VARCHAR" property="isreal" />
    <result column="ISPLAN" jdbcType="VARCHAR" property="isplan" />
    <result column="ISBALANCE" jdbcType="VARCHAR" property="isbalance" />
    <result column="HASPRODUCT" jdbcType="VARCHAR" property="hasproduct" />
    <result column="BCODE" jdbcType="VARCHAR" property="bcode" />
    <result column="BDESC1" jdbcType="VARCHAR" property="bdesc1" />
    <result column="BDESC2" jdbcType="VARCHAR" property="bdesc2" />
    <result column="ISSETTLE" jdbcType="VARCHAR" property="issettle" />
    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
    <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
    <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from T_RM_WORKPROC
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from T_RM_WORKPROC
    where 1=1
      <if test="name != null and name != ''">
        and NAME = #{name}
      </if>
      <if test="status != null and status != ''">
        and STATUS = #{status}
      </if>
      <if test="parentid != null and parentid != ''">
        and PARENTID = #{parentid}
      </if>
      <if test="node != null and node != ''">
        and NODE = #{node}
      </if>
      <if test="ename != null and ename != ''">
        and ENAME = #{ename}
      </if>
      <if test="aliasname != null and aliasname != ''">
        and ALIASNAME = #{aliasname}
      </if>
      <if test="seqno != null">
        and SEQNO = #{seqno}
      </if>
      <if test="isreal != null and isreal != ''">
        and ISREAL = #{isreal}
      </if>
      <if test="isplan != null and isplan != ''">
        and ISPLAN = #{isplan}
      </if>
      <if test="isbalance != null and isbalance != ''">
        and ISBALANCE = #{isbalance}
      </if>
      <if test="hasproduct != null and hasproduct != ''">
        and HASPRODUCT = #{hasproduct}
      </if>
      <if test="bcode != null and bcode != ''">
        and BCODE = #{bcode}
      </if>
      <if test="bdesc1 != null and bdesc1 != ''">
        and BDESC1 = #{bdesc1}
      </if>
      <if test="bdesc2 != null and bdesc2 != ''">
        and BDESC2 = #{bdesc2}
      </if>
      <if test="issettle != null and issettle != ''">
        and ISSETTLE = #{issettle}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    insert into T_RM_WORKPROC (ID, NAME, STATUS, 
      PARENTID, NODE, ENAME, 
      ALIASNAME, SEQNO, ISREAL, 
      ISPLAN, ISBALANCE, HASPRODUCT, BCODE,
      BDESC1, BDESC2, ISSETTLE, CREATEMAN, CREATETIME)
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
      #{parentid,jdbcType=VARCHAR}, #{node,jdbcType=VARCHAR}, #{ename,jdbcType=VARCHAR}, 
      #{aliasname,jdbcType=VARCHAR}, #{seqno,jdbcType=DECIMAL}, #{isreal,jdbcType=VARCHAR}, 
      #{isplan,jdbcType=VARCHAR}, #{isbalance,jdbcType=VARCHAR}, #{hasproduct,jdbcType=VARCHAR}, #{bcode,jdbcType=VARCHAR},
      #{bdesc1,jdbcType=VARCHAR}, #{bdesc2,jdbcType=VARCHAR}, #{issettle,jdbcType=VARCHAR},
      #{createman,jdbcType=VARCHAR}, SYSDATE)
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    insert into T_RM_WORKPROC
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="name != null">
        NAME,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="parentid != null">
        PARENTID,
      </if>
      <if test="node != null">
        NODE,
      </if>
      <if test="ename != null">
        ENAME,
      </if>
      <if test="aliasname != null">
        ALIASNAME,
      </if>
      <if test="seqno != null">
        SEQNO,
      </if>
      <if test="isreal != null">
        ISREAL,
      </if>
      <if test="isplan != null">
        ISPLAN,
      </if>
      <if test="isbalance != null">
        ISBALANCE,
      </if>
      <if test="bcode != null">
        BCODE,
      </if>
      <if test="bdesc1 != null">
        BDESC1,
      </if>
      <if test="bdesc2 != null">
        BDESC2,
      </if>
      <if test="issettle != null">
        ISSETTLE,
      </if>
        CREATEMAN,
        CREATETIME
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="parentid != null">
        #{parentid,jdbcType=VARCHAR},
      </if>
      <if test="node != null">
        #{node,jdbcType=VARCHAR},
      </if>
      <if test="ename != null">
        #{ename,jdbcType=VARCHAR},
      </if>
      <if test="aliasname != null">
        #{aliasname,jdbcType=VARCHAR},
      </if>
      <if test="seqno != null">
        #{seqno,jdbcType=DECIMAL},
      </if>
      <if test="isreal != null">
        #{isreal,jdbcType=VARCHAR},
      </if>
      <if test="isplan != null">
        #{isplan,jdbcType=VARCHAR},
      </if>
      <if test="isbalance != null">
        #{isbalance,jdbcType=VARCHAR},
      </if>
      <if test="hasproduct != null">
        #{hasproduct,jdbcType=VARCHAR},
      </if>
      <if test="bcode != null">
        #{bcode,jdbcType=VARCHAR},
      </if>
      <if test="bdesc1 != null">
        #{bdesc1,jdbcType=VARCHAR},
      </if>
      <if test="bdesc2 != null">
        #{bdesc2,jdbcType=VARCHAR},
      </if>
      <if test="issettle != null">
        #{issettle,jdbcType=VARCHAR},
      </if>
        #{createman,jdbcType=VARCHAR},
        SYSDATE
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    update T_RM_WORKPROC
    set NAME = #{name,jdbcType=VARCHAR},
      STATUS = #{status,jdbcType=VARCHAR},
      ENAME = #{ename,jdbcType=VARCHAR},
      ALIASNAME = #{aliasname,jdbcType=VARCHAR},
      SEQNO = #{seqno,jdbcType=DECIMAL},
      ISREAL = #{isreal,jdbcType=VARCHAR},
      ISPLAN = #{isplan,jdbcType=VARCHAR},
      ISBALANCE = #{isbalance,jdbcType=VARCHAR},
      HASPRODUCT = #{hasproduct,jdbcType=VARCHAR},
      BCODE = #{bcode,jdbcType=VARCHAR},
      BDESC1 = #{bdesc1,jdbcType=VARCHAR},
      BDESC2 = #{bdesc2,jdbcType=VARCHAR},
      ISSETTLE = #{issettle,jdbcType=VARCHAR},
      UPDATEMAN = #{updateman, jdbcType=VARCHAR},
      UPDATETIME = SYSDATE
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    update T_RM_WORKPROC
    <set>
      <if test="name != null">
        NAME = #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=VARCHAR},
      </if>
      <if test="parentid != null">
        PARENTID = #{parentid,jdbcType=VARCHAR},
      </if>
      <if test="node != null">
        NODE = #{node,jdbcType=VARCHAR},
      </if>
      <if test="ename != null">
        ENAME = #{ename,jdbcType=VARCHAR},
      </if>
      <if test="aliasname != null">
        ALIASNAME = #{aliasname,jdbcType=VARCHAR},
      </if>
      <if test="seqno != null">
        SEQNO = #{seqno,jdbcType=DECIMAL},
      </if>
      <if test="isreal != null">
        ISREAL = #{isreal,jdbcType=VARCHAR},
      </if>
      <if test="isplan != null">
        ISPLAN = #{isplan,jdbcType=VARCHAR},
      </if>
      <if test="isbalance != null">
        ISBALANCE = #{isbalance,jdbcType=VARCHAR},
      </if>
      <if test="hasproduct != null">
        HASPRODUCT = #{hasproduct,jdbcType=VARCHAR},
      </if>
      <if test="bcode != null">
        BCODE = #{bcode,jdbcType=VARCHAR},
      </if>
      <if test="bdesc1 != null">
        BDESC1 = #{bdesc1,jdbcType=VARCHAR},
      </if>
      <if test="bdesc2 != null">
        BDESC2 = #{bdesc2,jdbcType=VARCHAR},
      </if>
      <if test="issettle != null">
        ISSETTLE = #{issettle,jdbcType=VARCHAR},
      </if>
        UPDATEMAN = #{updateman, jdbcType=VARCHAR},
        UPDATETIME = SYSDATE
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select ID, NAME, STATUS, PARENTID, NODE, ENAME, ALIASNAME, SEQNO, ISREAL, ISPLAN, 
    ISBALANCE, HASPRODUCT, BCODE, BDESC1, BDESC2, ISSETTLE, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME
    from T_RM_WORKPROC
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select ID, NAME, STATUS, PARENTID, NODE, ENAME, ALIASNAME, SEQNO, ISREAL, ISPLAN, 
    ISBALANCE, HASPRODUCT, BCODE, BDESC1, BDESC2, ISSETTLE, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME
    from T_RM_WORKPROC
    <where>
      <if test="id != null and id != ''">
        and ID = #{id}
      </if>
      <if test="name != null and name != ''">
        and NAME = #{name}
      </if>
      <if test="status != null and status != ''">
        and STATUS = #{status}
      </if>
      <if test="parentid != null and parentid != ''">
        and PARENTID = #{parentid}
      </if>
      <if test="node != null and node != ''">
        and NODE = #{node}
      </if>
      <if test="ename != null and ename != ''">
        and ENAME = #{ename}
      </if>
      <if test="aliasname != null and aliasname != ''">
        and ALIASNAME = #{aliasname}
      </if>
      <if test="seqno != null">
        and SEQNO = #{seqno}
      </if>
      <if test="issettle != null and issettle != ''">
        and ISSETTLE = #{issettle}
      </if>
      <if test="isreal != null and isreal != ''">
        and ISREAL = #{isreal}
      </if>
      <if test="isplan != null and isplan != ''">
        and ISPLAN = #{isplan}
      </if>
      <if test="isbalance != null and isbalance != ''">
        and ISBALANCE = #{isbalance}
      </if>
      <if test="hasproduct != null and hasproduct != ''">
        and HASPRODUCT = #{hasproduct}
      </if>
      <if test="bcode != null and bcode != ''">
        and BCODE = #{bcode}
      </if>
      <if test="bdesc1 != null and bdesc1 != ''">
        and BDESC1 = #{bdesc1}
      </if>
      <if test="bdesc2 != null and bdesc2 != ''">
        and BDESC2 = #{bdesc2}
      </if>
    </where>
  </select>

  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select ID, NAME, STATUS, PARENTID, NODE, ENAME, ALIASNAME, SEQNO, ISREAL, ISPLAN, 
    ISBALANCE, HASPRODUCT, BCODE, BDESC1, BDESC2, ISSETTLE, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME
    from T_RM_WORKPROC
    WHERE 1=1
    <if test="id != null and id != ''">
      and ID LIKE '%${id}%'
    </if>
    <if test="parentid != null and parentid != ''">
      ${parentid}
    </if>
    <if test="name != null and name != ''">
      and NAME LIKE '%${name}%'
    </if>
    <if test="status != null and status != ''">
      and STATUS LIKE '%${status}%'
    </if>
    <if test="node != null and node != ''">
      and NODE LIKE '%${node}%'
    </if>
    <if test="ename != null and ename != ''">
      and ENAME LIKE '%${ename}%'
    </if>
    <if test="aliasname != null and aliasname != ''">
      and ALIASNAME LIKE '%${aliasname}%'
    </if>
    <if test="seqno != null">
      and SEQNO = #{seqno}
    </if>
    <if test="isreal != null and isreal != ''">
      and ISREAL = #{isreal}
    </if>
    <if test="isplan != null and isplan != ''">
      and ISPLAN = #{isplan}
    </if>
    <if test="isbalance != null and isbalance != ''">
      and ISBALANCE = #{isbalance}
    </if>
    <if test="bcode != null and bcode != ''">
      and BCODE LIKE '%${bcode}%'
    </if>
    <if test="bdesc1 != null and bdesc1 != ''">
      and BDESC1 LIKE '%${bdesc1}%'
    </if>
    <if test="bdesc2 != null and bdesc2 != ''">
      and BDESC2 LIKE '%${bdesc2}%'
    </if>
    <if test="issettle != null and issettle != ''">
      and ISSETTLE = #{issettle}
    </if>
    order by SEQNO
  </select>

  <insert id="batchInsert" parameterType="java.util.List">
    insert into T_RM_WORKPROC 
      (ID, 
      NAME, STATUS, PARENTID, NODE, ENAME, ALIASNAME,
      SEQNO, ISREAL, ISPLAN, ISBALANCE,
      HASPRODUCT, BCODE, BDESC1, 
      BDESC2, ISSETTLE, CREATEMAN, CREATETIME
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.id,jdbcType=VARCHAR}, 
      #{item.name,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.parentid,jdbcType=VARCHAR}, 
      #{item.node,jdbcType=VARCHAR}, #{item.ename,jdbcType=VARCHAR}, #{item.aliasname,jdbcType=VARCHAR}, 
      #{item.seqno,jdbcType=DECIMAL}, #{item.isreal,jdbcType=VARCHAR}, #{item.isplan,jdbcType=VARCHAR}, 
      #{item.isbalance,jdbcType=VARCHAR}, #{item.hasproduct,jdbcType=VARCHAR}, #{item.bcode,jdbcType=VARCHAR},
      #{item.bdesc1,jdbcType=VARCHAR}, #{item.bdesc2,jdbcType=VARCHAR}, #{item.issettle,jdbcType=VARCHAR},
      #{item.createman,jdbcType=VARCHAR}, SYSDATE
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update T_RM_WORKPROC
     set
       ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
       </foreach>
       ,NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.name,jdbcType=VARCHAR}
       </foreach>
       ,STATUS=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
       </foreach>
       ,PARENTID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.parentid,jdbcType=VARCHAR}
       </foreach>
       ,NODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.node,jdbcType=VARCHAR}
       </foreach>
       ,ENAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.ename,jdbcType=VARCHAR}
       </foreach>
       ,ALIASNAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.aliasname,jdbcType=VARCHAR}
       </foreach>
       ,SEQNO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.seqno,jdbcType=DECIMAL}
       </foreach>
       ,ISREAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.isreal,jdbcType=VARCHAR}
       </foreach>
       ,ISPLAN=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.isplan,jdbcType=VARCHAR}
       </foreach>
       ,ISBALANCE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.isbalance,jdbcType=VARCHAR}
       </foreach>
       ,HASPRODUCT=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.hasproduct,jdbcType=VARCHAR}
       </foreach>
       ,BCODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.bcode,jdbcType=VARCHAR}
       </foreach>
       ,BDESC1=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.bdesc1,jdbcType=VARCHAR}
       </foreach>
       ,BDESC2=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.bdesc2,jdbcType=VARCHAR}
       </foreach>
       ,ISSETTLE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.issettle,jdbcType=VARCHAR}
       </foreach>
        ,UPDATEMAN=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
            when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
        </foreach>
        ,UPDATETIME=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
            when #{item.id,jdbcType=VARCHAR} then SYSDATE
        </foreach>
     where ID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.id,jdbcType=VARCHAR}
    </foreach>
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from T_RM_WORKPROC
    where ID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <select id="getTree" resultMap="BaseResultMap">
    select ID, NAME, PARENTID, NODE from T_RM_WORKPROC
    WHERE 1=1
    <if test="issettle != null and issettle != ''">
      and ISSETTLE = #{issettle}
    </if>
    <if test="isreal != null and isreal != ''">
      and ISREAL = #{isreal}
    </if>
    <if test="isplan != null and isplan != ''">
      and ISPLAN = #{isplan}
    </if>
    <if test="isbalance != null and isbalance != ''">
      and ISBALANCE = #{isbalance}
    </if>
    <if test="hasproduct != null and hasproduct != ''">
      and HASPRODUCT = #{hasproduct}
    </if>
    order by SEQNO
  </select>

  <select id="getParent" resultMap="BaseResultMap">
    select ID, NAME, NODE from T_RM_WORKPROC
    where ID in (select distinct PARENTID from T_RM_WORKPROC)
    order by SEQNO
  </select>

  <!--查询下拉框的值-->
  <select id="getIdAndName" parameterType="java.util.HashMap" resultType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
      SELECT ID,NAME,NODE FROM T_RM_WORKPROC
      where 1=1
    <if test="issettle != null and issettle != ''">
      and ISSETTLE = #{issettle}
    </if>
    <if test="isreal != null and isreal != ''">
      and ISREAL = #{isreal}
    </if>
    <if test="isplan != null and isplan != ''">
      and ISPLAN = #{isplan}
    </if>
    <if test="isbalance != null and isbalance != ''">
      and ISBALANCE = #{isbalance}
    </if>
    <if test="hasproduct != null and hasproduct != ''">
      and HASPRODUCT = #{hasproduct}
    </if>
    <if test="id != null and id != ''">
      and id in (${id})
    </if>
      ORDER BY NAME
  </select>

  <select id="getMaxSeqNo" resultType="java.lang.Integer">
    SELECT MAX(SEQNO) FROM T_RM_WORKPROC
  </select>
  
  <!-- 根据转供电工序-站所（workshop），获取转供电工序列表 -->
  <select id="queryWorkprocs" parameterType="java.util.HashMap" resultType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
      SELECT ID,NAME,NODE FROM T_RM_WORKPROC
      where ISSETTLE = 1 and ID in
      (select workprocid from T_RM_ELECTRICITY_LOCATION where 1=1 ${workshop})
      ORDER BY NAME
  </select>

  <!--获取月计划工序列表-->
  <select id="queryPlanMoth"  resultType="com.steerinfo.ems.trmworkproc.model.TRmWorkproc">
    SELECT ID,NAME,NODE FROM T_RM_WORKPROC
      where ISSETTLE = 1 and ID in
      (select workprocid from EMS_PRODPLAN_MONTH where 1=1)
      ORDER BY NAME
  </select>
  <select id="getDataForPk" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    SELECT ID,NAME,NODE FROM T_RM_WORKPROC
    <where>
      <if test="workprocid != null and  workprocid != ''">
        and ID in  (${workprocid})
      </if>
    </where>
  </select>
</mapper>