| <?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="doumeemes.dao.ext.ProceduresExtMapper"> | 
|     <!-- 管理页面查询 --> | 
|     <resultMap id="ProceduresExtListVO" type="doumeemes.dao.ext.vo.ProceduresExtListVO" autoMapping="true"> | 
|         <id column="ID" jdbcType="INTEGER" property="id"/> | 
|         <association property="dmodel" javaType="doumeemes.dao.business.model.Department"> | 
|             <id column="DMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="DMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|             <result column="DMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|             <result column="DMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|             <result column="DMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|             <result column="DMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|             <result column="DMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="DMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|             <result column="DMODEL_ROOT_ID" jdbcType="INTEGER" property="rootId"/> | 
|             <result column="DMODEL_PARENT_ID" jdbcType="INTEGER" property="parentId"/> | 
|             <result column="DMODEL_COMPANY_ID" jdbcType="INTEGER" property="companyId"/> | 
|             <result column="DMODEL_TYPE" jdbcType="TINYINT" property="type"/> | 
|             <result column="DMODEL_ERP_ID" jdbcType="VARCHAR" property="erpId"/> | 
|             <result column="DMODEL_STATUS" jdbcType="INTEGER" property="status"/> | 
|             <result column="DMODEL_VALID_TIME" jdbcType="TIMESTAMP" property="validTime"/> | 
|             <result column="DMODEL_INVALID_TIME" jdbcType="TIMESTAMP" property="invalidTime"/> | 
|         </association> | 
|         <association property="orgmodel" javaType="doumeemes.dao.business.model.Department"> | 
|             <id column="ORGMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="ORGMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|             <result column="ORGMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|             <result column="ORGMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|             <result column="ORGMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|             <result column="ORGMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|             <result column="ORGMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="ORGMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|             <result column="ORGMODEL_ROOT_ID" jdbcType="INTEGER" property="rootId"/> | 
|             <result column="ORGMODEL_PARENT_ID" jdbcType="INTEGER" property="parentId"/> | 
|             <result column="ORGMODEL_COMPANY_ID" jdbcType="INTEGER" property="companyId"/> | 
|             <result column="ORGMODEL_TYPE" jdbcType="TINYINT" property="type"/> | 
|             <result column="ORGMODEL_ERP_ID" jdbcType="VARCHAR" property="erpId"/> | 
|             <result column="ORGMODEL_STATUS" jdbcType="INTEGER" property="status"/> | 
|             <result column="ORGMODEL_VALID_TIME" jdbcType="TIMESTAMP" property="validTime"/> | 
|             <result column="ORGMODEL_INVALID_TIME" jdbcType="TIMESTAMP" property="invalidTime"/> | 
|         </association> | 
|         <association property="umodel" javaType="doumeemes.dao.system.model.SystemUser"> | 
|             <id column="UMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="UMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|             <result column="UMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|             <result column="UMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|             <result column="UMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|             <result column="UMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|             <result column="UMODEL_FIXED" jdbcType="TINYINT" property="fixed"/> | 
|             <result column="UMODEL_PASSWORD" jdbcType="VARCHAR" property="password"/> | 
|             <result column="UMODEL_SALT" jdbcType="VARCHAR" property="salt"/> | 
|             <result column="UMODEL_AVATAR" jdbcType="VARCHAR" property="avatar"/> | 
|             <result column="UMODEL_MOBILE" jdbcType="VARCHAR" property="mobile"/> | 
|             <result column="UMODEL_EMAIL" jdbcType="VARCHAR" property="email"/> | 
|             <result column="UMODEL_SEX" jdbcType="VARCHAR" property="sex"/> | 
|             <result column="UMODEL_BIRTHDAY" jdbcType="DATE" property="birthday"/> | 
|             <result column="UMODEL_EMP_NO" jdbcType="VARCHAR" property="empNo"/> | 
|             <result column="UMODEL_REALNAME" jdbcType="VARCHAR" property="realname"/> | 
|             <result column="UMODEL_USERNAME" jdbcType="VARCHAR" property="username"/> | 
|             <result column="UMODEL_SYSTEMID" jdbcType="VARCHAR" property="systemid"/> | 
|             <result column="UMODEL_INVALID_TIME" jdbcType="TIMESTAMP" property="invalidTime"/> | 
|             <result column="UMODEL_TYPE" jdbcType="INTEGER" property="type"/> | 
|         </association> | 
|         <association property="pwmodel" javaType="doumeemes.dao.business.model.Warehouse"> | 
|             <id column="PWMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="PWMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|             <result column="PWMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|             <result column="PWMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|             <result column="PWMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|             <result column="PWMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|             <result column="PWMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|             <result column="PWMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|             <result column="PWMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|             <result column="PWMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|             <result column="PWMODEL_QRCODE" jdbcType="INTEGER" property="qrcode"/> | 
|             <result column="PWMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="PWMODEL_USE_LOCATION" jdbcType="TINYINT" property="useLocation"/> | 
|             <result column="PWMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|             <result column="PWMODEL_ADDR" jdbcType="VARCHAR" property="addr"/> | 
|         </association> | 
|         <association property="prowmodel" javaType="doumeemes.dao.business.model.Warehouse"> | 
|             <id column="PROWMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="PROWMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|             <result column="PROWMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|             <result column="PROWMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|             <result column="PROWMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|             <result column="PROWMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|             <result column="PROWMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|             <result column="PROWMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|             <result column="PROWMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|             <result column="PROWMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|             <result column="PROWMODEL_QRCODE" jdbcType="INTEGER" property="qrcode"/> | 
|             <result column="PROWMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="PROWMODEL_USE_LOCATION" jdbcType="TINYINT" property="useLocation"/> | 
|             <result column="PROWMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|             <result column="PROWMODEL_ADDR" jdbcType="VARCHAR" property="addr"/> | 
|         </association> | 
|   | 
|         <association property="bwmodel" javaType="doumeemes.dao.business.model.Warehouse"> | 
|             <id column="BWMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="BWMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|             <result column="BWMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|             <result column="BWMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|             <result column="BWMODEL_QRCODE" jdbcType="INTEGER" property="qrcode"/> | 
|             <result column="BWMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="BWMODEL_USE_LOCATION" jdbcType="TINYINT" property="useLocation"/> | 
|             <result column="BWMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|             <result column="BWMODEL_ADDR" jdbcType="VARCHAR" property="addr"/> | 
|         </association> | 
|   | 
|         <association property="twmodel" javaType="doumeemes.dao.business.model.Warehouse"> | 
|             <id column="TWMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|             <result column="TWMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|             <result column="TWMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|             <result column="TWMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|             <result column="TWMODEL_QRCODE" jdbcType="INTEGER" property="qrcode"/> | 
|             <result column="TWMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|             <result column="TWMODEL_USE_LOCATION" jdbcType="TINYINT" property="useLocation"/> | 
|             <result column="TWMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|             <result column="TWMODEL_ADDR" jdbcType="VARCHAR" property="addr"/> | 
|         </association> | 
|     </resultMap> | 
|     <select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryProceduresExtDTO" resultMap="ProceduresExtListVO"> | 
|         SELECT | 
|         `a`.*, | 
|         `dmodel`.`ID` AS DMODEL_ID, | 
|         `dmodel`.`DELETED` AS DMODEL_DELETED, | 
|         `dmodel`.`CREATE_USER` AS DMODEL_CREATE_USER, | 
|         `dmodel`.`CREATE_TIME` AS DMODEL_CREATE_TIME, | 
|         `dmodel`.`UPDATE_USER` AS DMODEL_UPDATE_USER, | 
|         `dmodel`.`UPDATE_TIME` AS DMODEL_UPDATE_TIME, | 
|         `dmodel`.`NAME` AS DMODEL_NAME, | 
|         `dmodel`.`REMARK` AS DMODEL_REMARK, | 
|         `dmodel`.`ROOT_ID` AS DMODEL_ROOT_ID, | 
|         `dmodel`.`PARENT_ID` AS DMODEL_PARENT_ID, | 
|         `dmodel`.`COMPANY_ID` AS DMODEL_COMPANY_ID, | 
|         `dmodel`.`TYPE` AS DMODEL_TYPE, | 
|         `dmodel`.`ERP_ID` AS DMODEL_ERP_ID, | 
|         `dmodel`.`STATUS` AS DMODEL_STATUS, | 
|         `dmodel`.`VALID_TIME` AS DMODEL_VALID_TIME, | 
|         `dmodel`.`INVALID_TIME` AS DMODEL_INVALID_TIME, | 
|         `orgmodel`.`ID` AS ORGMODEL_ID, | 
|         `orgmodel`.`DELETED` AS ORGMODEL_DELETED, | 
|         `orgmodel`.`CREATE_USER` AS ORGMODEL_CREATE_USER, | 
|         `orgmodel`.`CREATE_TIME` AS ORGMODEL_CREATE_TIME, | 
|         `orgmodel`.`UPDATE_USER` AS ORGMODEL_UPDATE_USER, | 
|         `orgmodel`.`UPDATE_TIME` AS ORGMODEL_UPDATE_TIME, | 
|         `orgmodel`.`NAME` AS ORGMODEL_NAME, | 
|         `orgmodel`.`REMARK` AS ORGMODEL_REMARK, | 
|         `orgmodel`.`ROOT_ID` AS ORGMODEL_ROOT_ID, | 
|         `orgmodel`.`PARENT_ID` AS ORGMODEL_PARENT_ID, | 
|         `orgmodel`.`COMPANY_ID` AS ORGMODEL_COMPANY_ID, | 
|         `orgmodel`.`TYPE` AS ORGMODEL_TYPE, | 
|         `orgmodel`.`ERP_ID` AS ORGMODEL_ERP_ID, | 
|         `orgmodel`.`STATUS` AS ORGMODEL_STATUS, | 
|         `orgmodel`.`VALID_TIME` AS ORGMODEL_VALID_TIME, | 
|         `orgmodel`.`INVALID_TIME` AS ORGMODEL_INVALID_TIME, | 
|         `umodel`.`ID` AS UMODEL_ID, | 
|         `umodel`.`DELETED` AS UMODEL_DELETED, | 
|         `umodel`.`CREATE_USER` AS UMODEL_CREATE_USER, | 
|         `umodel`.`CREATE_TIME` AS UMODEL_CREATE_TIME, | 
|         `umodel`.`UPDATE_USER` AS UMODEL_UPDATE_USER, | 
|         `umodel`.`UPDATE_TIME` AS UMODEL_UPDATE_TIME, | 
|         `umodel`.`FIXED` AS UMODEL_FIXED, | 
|         `umodel`.`PASSWORD` AS UMODEL_PASSWORD, | 
|         `umodel`.`SALT` AS UMODEL_SALT, | 
|         `umodel`.`AVATAR` AS UMODEL_AVATAR, | 
|         `umodel`.`MOBILE` AS UMODEL_MOBILE, | 
|         `umodel`.`EMAIL` AS UMODEL_EMAIL, | 
|         `umodel`.`SEX` AS UMODEL_SEX, | 
|         `umodel`.`BIRTHDAY` AS UMODEL_BIRTHDAY, | 
|         `umodel`.`EMP_NO` AS UMODEL_EMP_NO, | 
|         `umodel`.`REALNAME` AS UMODEL_REALNAME, | 
|         `umodel`.`USERNAME` AS UMODEL_USERNAME, | 
|         `umodel`.`SYSTEMID` AS UMODEL_SYSTEMID, | 
|         `umodel`.`INVALID_TIME` AS UMODEL_INVALID_TIME, | 
|         `umodel`.`TYPE` AS UMODEL_TYPE, | 
|         `pwmodel`.`ID` AS PWMODEL_ID, | 
|         `pwmodel`.`DELETED` AS PWMODEL_DELETED, | 
|         `pwmodel`.`CREATE_USER` AS PWMODEL_CREATE_USER, | 
|         `pwmodel`.`CREATE_TIME` AS PWMODEL_CREATE_TIME, | 
|         `pwmodel`.`UPDATE_USER` AS PWMODEL_UPDATE_USER, | 
|         `pwmodel`.`UPDATE_TIME` AS PWMODEL_UPDATE_TIME, | 
|         `pwmodel`.`REMARK` AS PWMODEL_REMARK, | 
|         `pwmodel`.`ROOT_DEPART_ID` AS PWMODEL_ROOT_DEPART_ID, | 
|         `pwmodel`.`DEPART_ID` AS PWMODEL_DEPART_ID, | 
|         `pwmodel`.`PROCEDURE_ID` AS PWMODEL_PROCEDURE_ID, | 
|         `pwmodel`.`QRCODE` AS PWMODEL_QRCODE, | 
|         `pwmodel`.`NAME` AS PWMODEL_NAME, | 
|         `pwmodel`.`USE_LOCATION` AS PWMODEL_USE_LOCATION, | 
|         `pwmodel`.`STATUS` AS PWMODEL_STATUS, | 
|         `pwmodel`.`ADDR` AS PWMODEL_ADDR, | 
|         `prowmodel`.`ID` AS PROWMODEL_ID, | 
|         `prowmodel`.`DELETED` AS PROWMODEL_DELETED, | 
|         `prowmodel`.`CREATE_USER` AS PROWMODEL_CREATE_USER, | 
|         `prowmodel`.`CREATE_TIME` AS PROWMODEL_CREATE_TIME, | 
|         `prowmodel`.`UPDATE_USER` AS PROWMODEL_UPDATE_USER, | 
|         `prowmodel`.`UPDATE_TIME` AS PROWMODEL_UPDATE_TIME, | 
|         `prowmodel`.`REMARK` AS PROWMODEL_REMARK, | 
|         `prowmodel`.`ROOT_DEPART_ID` AS PROWMODEL_ROOT_DEPART_ID, | 
|         `prowmodel`.`DEPART_ID` AS PROWMODEL_DEPART_ID, | 
|         `prowmodel`.`PROCEDURE_ID` AS PROWMODEL_PROCEDURE_ID, | 
|         `prowmodel`.`QRCODE` AS PROWMODEL_QRCODE, | 
|         `prowmodel`.`NAME` AS PROWMODEL_NAME, | 
|         `prowmodel`.`USE_LOCATION` AS PROWMODEL_USE_LOCATION, | 
|         `prowmodel`.`STATUS` AS PROWMODEL_STATUS, | 
|         `prowmodel`.`ADDR` AS PROWMODEL_ADDR, | 
|   | 
|         `twmodel`.`ID` AS TWMODEL_ID, | 
|         `twmodel`.`DELETED` AS TWMODEL_DELETED, | 
|         `twmodel`.`CREATE_USER` AS TWMODEL_CREATE_USER, | 
|         `twmodel`.`CREATE_TIME` AS TWMODEL_CREATE_TIME, | 
|         `twmodel`.`UPDATE_USER` AS TWMODEL_UPDATE_USER, | 
|         `twmodel`.`UPDATE_TIME` AS TWMODEL_UPDATE_TIME, | 
|         `twmodel`.`REMARK` AS TWMODEL_REMARK, | 
|         `twmodel`.`ROOT_DEPART_ID` AS TWMODEL_ROOT_DEPART_ID, | 
|         `twmodel`.`DEPART_ID` AS TWMODEL_DEPART_ID, | 
|         `twmodel`.`PROCEDURE_ID` AS TWMODEL_PROCEDURE_ID, | 
|         `twmodel`.`QRCODE` AS TWMODEL_QRCODE, | 
|         `twmodel`.`NAME` AS TWMODEL_NAME, | 
|         `twmodel`.`USE_LOCATION` AS TWMODEL_USE_LOCATION, | 
|         `twmodel`.`STATUS` AS TWMODEL_STATUS, | 
|         `twmodel`.`ADDR` AS TWMODEL_ADDR, | 
|   | 
|         `bwmodel`.`ID` AS BWMODEL_ID, | 
|         `bwmodel`.`DELETED` AS BWMODEL_DELETED, | 
|         `bwmodel`.`CREATE_USER` AS BWMODEL_CREATE_USER, | 
|         `bwmodel`.`CREATE_TIME` AS BWMODEL_CREATE_TIME, | 
|         `bwmodel`.`UPDATE_USER` AS BWMODEL_UPDATE_USER, | 
|         `bwmodel`.`UPDATE_TIME` AS BWMODEL_UPDATE_TIME, | 
|         `bwmodel`.`REMARK` AS BWMODEL_REMARK, | 
|         `bwmodel`.`ROOT_DEPART_ID` AS BWMODEL_ROOT_DEPART_ID, | 
|         `bwmodel`.`DEPART_ID` AS BWMODEL_DEPART_ID, | 
|         `bwmodel`.`PROCEDURE_ID` AS BWMODEL_PROCEDURE_ID, | 
|         `bwmodel`.`QRCODE` AS BWMODEL_QRCODE, | 
|         `bwmodel`.`NAME` AS BWMODEL_NAME, | 
|         `bwmodel`.`USE_LOCATION` AS BWMODEL_USE_LOCATION, | 
|         `bwmodel`.`STATUS` AS BWMODEL_STATUS, | 
|         `bwmodel`.`ADDR` AS BWMODEL_ADDR | 
|   | 
|         FROM `procedures` `a` | 
|         LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID | 
|         LEFT JOIN `department` `orgmodel` ON a.ORG_ID=orgmodel.ID | 
|         LEFT JOIN `system_user` `umodel` ON a.USER_ID=umodel.ID | 
|         LEFT JOIN `warehouse` `pwmodel` ON a.PICKING_WAREHOUSE_ID=pwmodel.ID | 
|         LEFT JOIN `warehouse` `prowmodel` ON a.PRODUCE_WAREHOUSE_ID=prowmodel.ID | 
|         LEFT JOIN `warehouse` `twmodel` ON a.TOBESCRAPPED_WAREHOUSE_ID=twmodel.ID | 
|         LEFT JOIN `warehouse` `bwmodel` ON a.BAD_WAREHOUSE_ID=bwmodel.ID | 
|         <where> | 
|             <if test="niIds != null and niIds!=''"> | 
|                 AND not FIND_IN_SET(`a`.`ID`,#{niIds}) | 
|             </if> | 
|             <if test="id != null"> | 
|                 AND `a`.`ID` = #{id} | 
|             </if> | 
|             <if test="deleted != null"> | 
|                 AND `a`.`DELETED` = #{deleted} | 
|             </if> | 
|             <if test="createUser != null"> | 
|                 AND `a`.`CREATE_USER` = #{createUser} | 
|             </if> | 
|             <if test="createTime != null"> | 
|                 AND `a`.`CREATE_TIME` = #{createTime} | 
|             </if> | 
|             <if test="updateUser != null"> | 
|                 AND `a`.`UPDATE_USER` = #{updateUser} | 
|             </if> | 
|             <if test="updateTime != null"> | 
|                 AND `a`.`UPDATE_TIME` = #{updateTime} | 
|             </if> | 
|             <if test="remark != null and remark != ''"> | 
|                 AND `a`.`REMARK` = #{remark} | 
|             </if> | 
|             <if test="rootDepartId != null"> | 
|                 AND `a`.`ROOT_DEPART_ID` = #{rootDepartId} | 
|             </if> | 
|             <if test="departId != null"> | 
|                 AND `a`.`DEPART_ID` = #{departId} | 
|             </if> | 
|             <if test="code != null and code != ''"> | 
|                 AND `a`.`CODE` = #{code} | 
|             </if> | 
|             <if test="name != null and name != ''"> | 
|                 AND `a`.`NAME` like concat('%',#{name},'%') | 
|             </if> | 
|             <if test="sortnum != null"> | 
|                 AND `a`.`SORTNUM` = #{sortnum} | 
|             </if> | 
|             <if test="orgId != null"> | 
|                 AND `a`.`ORG_ID` = #{orgId} | 
|             </if> | 
|             <if test="userId != null"> | 
|                 AND `a`.`USER_ID` = #{userId} | 
|             </if> | 
|             <if test="pickingWarehouseId != null"> | 
|                 AND `a`.`PICKING_WAREHOUSE_ID` = #{pickingWarehouseId} | 
|             </if> | 
|             <if test="produceWarehouseId != null"> | 
|                 AND `a`.`PRODUCE_WAREHOUSE_ID` = #{produceWarehouseId} | 
|             </if> | 
|             <if test="level != null"> | 
|                 AND `a`.`LEVEL` = #{level} | 
|             </if> | 
|             <if test="dmodelId != null"> | 
|                 AND `dmodel`.`ID` = #{dmodelId} | 
|             </if> | 
|             <if test="dmodelDeleted != null"> | 
|                 AND `dmodel`.`DELETED` = #{dmodelDeleted} | 
|             </if> | 
|             <if test="dmodelCreateUser != null"> | 
|                 AND `dmodel`.`CREATE_USER` = #{dmodelCreateUser} | 
|             </if> | 
|             <if test="dmodelCreateTime != null"> | 
|                 AND `dmodel`.`CREATE_TIME` = #{dmodelCreateTime} | 
|             </if> | 
|             <if test="dmodelUpdateUser != null"> | 
|                 AND `dmodel`.`UPDATE_USER` = #{dmodelUpdateUser} | 
|             </if> | 
|             <if test="dmodelUpdateTime != null"> | 
|                 AND `dmodel`.`UPDATE_TIME` = #{dmodelUpdateTime} | 
|             </if> | 
|             <if test="dmodelName != null and dmodelName != ''"> | 
|                 AND `dmodel`.`NAME` = #{dmodelName} | 
|             </if> | 
|             <if test="dmodelRemark != null and dmodelRemark != ''"> | 
|                 AND `dmodel`.`REMARK` = #{dmodelRemark} | 
|             </if> | 
|             <if test="dmodelRootId != null"> | 
|                 AND `dmodel`.`ROOT_ID` = #{dmodelRootId} | 
|             </if> | 
|             <if test="dmodelParentId != null"> | 
|                 AND `dmodel`.`PARENT_ID` = #{dmodelParentId} | 
|             </if> | 
|             <if test="dmodelCompanyId != null"> | 
|                 AND `dmodel`.`COMPANY_ID` = #{dmodelCompanyId} | 
|             </if> | 
|             <if test="dmodelType != null"> | 
|                 AND `dmodel`.`TYPE` = #{dmodelType} | 
|             </if> | 
|             <if test="dmodelErpId != null and dmodelErpId != ''"> | 
|                 AND `dmodel`.`ERP_ID` = #{dmodelErpId} | 
|             </if> | 
|             <if test="dmodelStatus != null"> | 
|                 AND `dmodel`.`STATUS` = #{dmodelStatus} | 
|             </if> | 
|             <if test="dmodelValidTime != null"> | 
|                 AND `dmodel`.`VALID_TIME` = #{dmodelValidTime} | 
|             </if> | 
|             <if test="dmodelInvalidTime != null"> | 
|                 AND `dmodel`.`INVALID_TIME` = #{dmodelInvalidTime} | 
|             </if> | 
|             <if test="orgmodelId != null"> | 
|                 AND `orgmodel`.`ID` = #{orgmodelId} | 
|             </if> | 
|             <if test="orgmodelDeleted != null"> | 
|                 AND `orgmodel`.`DELETED` = #{orgmodelDeleted} | 
|             </if> | 
|             <if test="orgmodelCreateUser != null"> | 
|                 AND `orgmodel`.`CREATE_USER` = #{orgmodelCreateUser} | 
|             </if> | 
|             <if test="orgmodelCreateTime != null"> | 
|                 AND `orgmodel`.`CREATE_TIME` = #{orgmodelCreateTime} | 
|             </if> | 
|             <if test="orgmodelUpdateUser != null"> | 
|                 AND `orgmodel`.`UPDATE_USER` = #{orgmodelUpdateUser} | 
|             </if> | 
|             <if test="orgmodelUpdateTime != null"> | 
|                 AND `orgmodel`.`UPDATE_TIME` = #{orgmodelUpdateTime} | 
|             </if> | 
|             <if test="orgmodelName != null and orgmodelName != ''"> | 
|                 AND `orgmodel`.`NAME` = #{orgmodelName} | 
|             </if> | 
|             <if test="orgmodelRemark != null and orgmodelRemark != ''"> | 
|                 AND `orgmodel`.`REMARK` = #{orgmodelRemark} | 
|             </if> | 
|             <if test="orgmodelRootId != null"> | 
|                 AND `orgmodel`.`ROOT_ID` = #{orgmodelRootId} | 
|             </if> | 
|             <if test="orgmodelParentId != null"> | 
|                 AND `orgmodel`.`PARENT_ID` = #{orgmodelParentId} | 
|             </if> | 
|             <if test="orgmodelCompanyId != null"> | 
|                 AND `orgmodel`.`COMPANY_ID` = #{orgmodelCompanyId} | 
|             </if> | 
|             <if test="orgmodelType != null"> | 
|                 AND `orgmodel`.`TYPE` = #{orgmodelType} | 
|             </if> | 
|             <if test="orgmodelErpId != null and orgmodelErpId != ''"> | 
|                 AND `orgmodel`.`ERP_ID` = #{orgmodelErpId} | 
|             </if> | 
|             <if test="orgmodelStatus != null"> | 
|                 AND `orgmodel`.`STATUS` = #{orgmodelStatus} | 
|             </if> | 
|             <if test="orgmodelValidTime != null"> | 
|                 AND `orgmodel`.`VALID_TIME` = #{orgmodelValidTime} | 
|             </if> | 
|             <if test="orgmodelInvalidTime != null"> | 
|                 AND `orgmodel`.`INVALID_TIME` = #{orgmodelInvalidTime} | 
|             </if> | 
|             <if test="umodelId != null"> | 
|                 AND `umodel`.`ID` = #{umodelId} | 
|             </if> | 
|             <if test="umodelDeleted != null"> | 
|                 AND `umodel`.`DELETED` = #{umodelDeleted} | 
|             </if> | 
|             <if test="umodelCreateUser != null"> | 
|                 AND `umodel`.`CREATE_USER` = #{umodelCreateUser} | 
|             </if> | 
|             <if test="umodelCreateTime != null"> | 
|                 AND `umodel`.`CREATE_TIME` = #{umodelCreateTime} | 
|             </if> | 
|             <if test="umodelUpdateUser != null"> | 
|                 AND `umodel`.`UPDATE_USER` = #{umodelUpdateUser} | 
|             </if> | 
|             <if test="umodelUpdateTime != null"> | 
|                 AND `umodel`.`UPDATE_TIME` = #{umodelUpdateTime} | 
|             </if> | 
|             <if test="umodelFixed != null"> | 
|                 AND `umodel`.`FIXED` = #{umodelFixed} | 
|             </if> | 
|             <if test="umodelPassword != null and umodelPassword != ''"> | 
|                 AND `umodel`.`PASSWORD` = #{umodelPassword} | 
|             </if> | 
|             <if test="umodelSalt != null and umodelSalt != ''"> | 
|                 AND `umodel`.`SALT` = #{umodelSalt} | 
|             </if> | 
|             <if test="umodelAvatar != null and umodelAvatar != ''"> | 
|                 AND `umodel`.`AVATAR` = #{umodelAvatar} | 
|             </if> | 
|             <if test="umodelMobile != null and umodelMobile != ''"> | 
|                 AND `umodel`.`MOBILE` = #{umodelMobile} | 
|             </if> | 
|             <if test="umodelEmail != null and umodelEmail != ''"> | 
|                 AND `umodel`.`EMAIL` = #{umodelEmail} | 
|             </if> | 
|             <if test="umodelSex != null and umodelSex != ''"> | 
|                 AND `umodel`.`SEX` = #{umodelSex} | 
|             </if> | 
|             <if test="umodelBirthday != null"> | 
|                 AND `umodel`.`BIRTHDAY` = #{umodelBirthday} | 
|             </if> | 
|             <if test="umodelEmpNo != null and umodelEmpNo != ''"> | 
|                 AND `umodel`.`EMP_NO` = #{umodelEmpNo} | 
|             </if> | 
|             <if test="umodelRealname != null and umodelRealname != ''"> | 
|                 AND `umodel`.`REALNAME` = #{umodelRealname} | 
|             </if> | 
|             <if test="umodelUsername != null and umodelUsername != ''"> | 
|                 AND (`umodel`.`REALNAME` like concat('%', #{umodelUsername},'%') or `umodel`.`MOBILE` = | 
|                 #{umodelUsername}) | 
|             </if> | 
|             <if test="umodelSystemid != null and umodelSystemid != ''"> | 
|                 AND `umodel`.`SYSTEMID` = #{umodelSystemid} | 
|             </if> | 
|             <if test="umodelInvalidTime != null"> | 
|                 AND `umodel`.`INVALID_TIME` = #{umodelInvalidTime} | 
|             </if> | 
|             <if test="umodelType != null"> | 
|                 AND `umodel`.`TYPE` = #{umodelType} | 
|             </if> | 
|             <if test="pwmodelId != null"> | 
|                 AND `pwmodel`.`ID` = #{pwmodelId} | 
|             </if> | 
|             <if test="pwmodelDeleted != null"> | 
|                 AND `pwmodel`.`DELETED` = #{pwmodelDeleted} | 
|             </if> | 
|             <if test="pwmodelCreateUser != null"> | 
|                 AND `pwmodel`.`CREATE_USER` = #{pwmodelCreateUser} | 
|             </if> | 
|             <if test="pwmodelCreateTime != null"> | 
|                 AND `pwmodel`.`CREATE_TIME` = #{pwmodelCreateTime} | 
|             </if> | 
|             <if test="pwmodelUpdateUser != null"> | 
|                 AND `pwmodel`.`UPDATE_USER` = #{pwmodelUpdateUser} | 
|             </if> | 
|             <if test="pwmodelUpdateTime != null"> | 
|                 AND `pwmodel`.`UPDATE_TIME` = #{pwmodelUpdateTime} | 
|             </if> | 
|             <if test="pwmodelRemark != null and pwmodelRemark != ''"> | 
|                 AND `pwmodel`.`REMARK` = #{pwmodelRemark} | 
|             </if> | 
|             <if test="pwmodelRootDepartId != null"> | 
|                 AND `pwmodel`.`ROOT_DEPART_ID` = #{pwmodelRootDepartId} | 
|             </if> | 
|             <if test="pwmodelDepartId != null"> | 
|                 AND `pwmodel`.`DEPART_ID` = #{pwmodelDepartId} | 
|             </if> | 
|             <if test="pwmodelProcedureId != null"> | 
|                 AND `pwmodel`.`PROCEDURE_ID` = #{pwmodelProcedureId} | 
|             </if> | 
|             <if test="pwmodelQrcode != null"> | 
|                 AND `pwmodel`.`QRCODE` = #{pwmodelQrcode} | 
|             </if> | 
|             <if test="pwmodelName != null and pwmodelName != ''"> | 
|                 AND `pwmodel`.`NAME` = #{pwmodelName} | 
|             </if> | 
|             <if test="pwmodelUseLocation != null"> | 
|                 AND `pwmodel`.`USE_LOCATION` = #{pwmodelUseLocation} | 
|             </if> | 
|             <if test="pwmodelStatus != null"> | 
|                 AND `pwmodel`.`STATUS` = #{pwmodelStatus} | 
|             </if> | 
|             <if test="pwmodelAddr != null and pwmodelAddr != ''"> | 
|                 AND `pwmodel`.`ADDR` = #{pwmodelAddr} | 
|             </if> | 
|             <if test="prowmodelId != null"> | 
|                 AND `prowmodel`.`ID` = #{prowmodelId} | 
|             </if> | 
|             <if test="prowmodelDeleted != null"> | 
|                 AND `prowmodel`.`DELETED` = #{prowmodelDeleted} | 
|             </if> | 
|             <if test="prowmodelCreateUser != null"> | 
|                 AND `prowmodel`.`CREATE_USER` = #{prowmodelCreateUser} | 
|             </if> | 
|             <if test="prowmodelCreateTime != null"> | 
|                 AND `prowmodel`.`CREATE_TIME` = #{prowmodelCreateTime} | 
|             </if> | 
|             <if test="prowmodelUpdateUser != null"> | 
|                 AND `prowmodel`.`UPDATE_USER` = #{prowmodelUpdateUser} | 
|             </if> | 
|             <if test="prowmodelUpdateTime != null"> | 
|                 AND `prowmodel`.`UPDATE_TIME` = #{prowmodelUpdateTime} | 
|             </if> | 
|             <if test="prowmodelRemark != null and prowmodelRemark != ''"> | 
|                 AND `prowmodel`.`REMARK` = #{prowmodelRemark} | 
|             </if> | 
|             <if test="prowmodelRootDepartId != null"> | 
|                 AND `prowmodel`.`ROOT_DEPART_ID` = #{prowmodelRootDepartId} | 
|             </if> | 
|             <if test="prowmodelDepartId != null"> | 
|                 AND `prowmodel`.`DEPART_ID` = #{prowmodelDepartId} | 
|             </if> | 
|             <if test="prowmodelProcedureId != null"> | 
|                 AND `prowmodel`.`PROCEDURE_ID` = #{prowmodelProcedureId} | 
|             </if> | 
|             <if test="prowmodelQrcode != null"> | 
|                 AND `prowmodel`.`QRCODE` = #{prowmodelQrcode} | 
|             </if> | 
|             <if test="prowmodelName != null and prowmodelName != ''"> | 
|                 AND `prowmodel`.`NAME` = #{prowmodelName} | 
|             </if> | 
|             <if test="prowmodelUseLocation != null"> | 
|                 AND `prowmodel`.`USE_LOCATION` = #{prowmodelUseLocation} | 
|             </if> | 
|             <if test="prowmodelStatus != null"> | 
|                 AND `prowmodel`.`STATUS` = #{prowmodelStatus} | 
|             </if> | 
|             <if test="prowmodelAddr != null and prowmodelAddr != ''"> | 
|                 AND `prowmodel`.`ADDR` = #{prowmodelAddr} | 
|             </if> | 
|             <if test="ids != null and ids.size()>0"> | 
|                 AND a.id in <foreach collection="ids" item="item" open="(" close=")" separator=",">#{item}</foreach> | 
|             </if> | 
|         </where> | 
|         order by a.SORTNUM asc,`a`.`ID` desc | 
|     </select> | 
|   | 
|   | 
|     <select id="getGYListByCondition" parameterType="doumeemes.dao.ext.dto.QueryProceduresExtDTO" resultMap="ProceduresExtListVO"> | 
|         SELECT `a`.*, | 
|                dmodel.id as dmodelRouteProductId | 
|         FROM `procedures` `a` | 
|         LEFT JOIN route_procedure `dmodel`  on dmodel.PROCEDURE_ID=a.id | 
|         where dmodel.ROUTE_ID=#{routeId} and dmodel.DELETED=0 and `a`.`DELETED`=0 order by dmodel.SORTNUM asc | 
|     </select> | 
|   | 
|   | 
|   | 
|     <select id="getListByMaterialId" parameterType="doumeemes.dao.ext.dto.QueryProceduresExtDTO" resultMap="ProceduresExtListVO"> | 
|         SELECT `a`.* | 
|         FROM `procedures` `a` | 
|                  LEFT JOIN route_procedure `dmodel`  on dmodel.PROCEDURE_ID=a.id | 
|         where dmodel.ROUTE_ID=#{routeId} and dmodel.DELETED=0 and `a`.`DELETED`=0 | 
|     </select> | 
|   | 
|   | 
|   | 
|   | 
|   | 
| </mapper> |