| <?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.WorkorderUserExtMapper"> | 
|   | 
|   <!-- 管理页面查询 --> | 
|   <resultMap id="WorkorderUserExtListVO" type="doumeemes.dao.ext.vo.WorkorderUserExtListVO" 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="pmodel" javaType="doumeemes.dao.business.model.Plans"> | 
|       <id column="PMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|       <result column="PMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|       <result column="PMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|       <result column="PMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|       <result column="PMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|       <result column="PMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|       <result column="PMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="PMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="PMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|       <result column="PMODEL_ORIGIN" jdbcType="TINYINT" property="origin"/> | 
|       <result column="PMODEL_PLAN_DATE" jdbcType="TIMESTAMP" property="planDate"/> | 
|       <result column="PMODEL_MATERIAL_ID" jdbcType="INTEGER" property="materialId"/> | 
|       <result column="PMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|       <result column="PMODEL_FACTORY_ID" jdbcType="INTEGER" property="factoryId"/> | 
|       <result column="PMODEL_UNIT_ID" jdbcType="INTEGER" property="unitId"/> | 
|       <result column="PMODEL_NUM" jdbcType="INTEGER" property="num"/> | 
|       <result column="PMODEL_BATCH" jdbcType="VARCHAR" property="batch"/> | 
|       <result column="PMODEL_URGENT" jdbcType="TINYINT" property="urgent"/> | 
|       <result column="PMODEL_IMPORT_ID" jdbcType="INTEGER" property="importId"/> | 
|       <result column="PMODEL_USER_ID" jdbcType="INTEGER" property="userId"/> | 
|       <result column="PMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|       <result column="PMODEL_PUBLISH_DATE" jdbcType="TIMESTAMP" property="publishDate"/> | 
|     </association> | 
|     <association property="wmodel" javaType="doumeemes.dao.business.model.Workorder"> | 
|       <id column="WMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|       <result column="WMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|       <result column="WMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|       <result column="WMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|       <result column="WMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|       <result column="WMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|       <result column="WMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="WMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="WMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|       <result column="WMODEL_PLAN_ID" jdbcType="INTEGER" property="planId"/> | 
|       <result column="WMODEL_FACTORY_ID" jdbcType="INTEGER" property="factoryId"/> | 
|       <result column="WMODEL_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|       <result column="WMODEL_CODE" jdbcType="VARCHAR" property="code"/> | 
|       <result column="WMODEL_ORIGIN_WORKORDER_ID" jdbcType="INTEGER" property="originWorkorderId"/> | 
|       <result column="WMODEL_TYPE_ID" jdbcType="INTEGER" property="typeId"/> | 
|       <result column="WMODEL_ORIGIN_ID" jdbcType="INTEGER" property="originId"/> | 
|       <result column="WMODEL_PLAN_DATE" jdbcType="TIMESTAMP" property="planDate"/> | 
|       <result column="WMODEL_PLAN_NUM" jdbcType="INTEGER" property="planNum"/> | 
|       <result column="WMODEL_MATERIAL_ID" jdbcType="INTEGER" property="materialId"/> | 
|       <result column="WMODEL_UNIT_ID" jdbcType="INTEGER" property="unitId"/> | 
|       <result column="WMODEL_BATCH" jdbcType="VARCHAR" property="batch"/> | 
|       <result column="WMODEL_PRO_USER_ID" jdbcType="INTEGER" property="proUserId"/> | 
|       <result column="WMODEL_PRO_GROUP_ID" jdbcType="INTEGER" property="proGroupId"/> | 
|       <result column="WMODEL_QUALIFIED_NUM" jdbcType="INTEGER" property="qualifiedNum"/> | 
|       <result column="WMODEL_UNQUALIFIED_NUM" jdbcType="INTEGER" property="unqualifiedNum"/> | 
|       <result column="WMODEL_CHECK_USER_ID" jdbcType="INTEGER" property="checkUserId"/> | 
|       <result column="WMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|       <result column="WMODEL_LAST_DEAL_DATE" jdbcType="TIMESTAMP" property="lastDealDate"/> | 
|       <result column="WMODEL_LAST_DEAL_INFO" jdbcType="VARCHAR" property="lastDealInfo"/> | 
|       <result column="WMODEL_URGENT" jdbcType="TINYINT" property="urgent"/> | 
|     </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> | 
|   </resultMap> | 
|   <select id="selectListByOrder" parameterType="doumeemes.dao.ext.dto.QueryWorkorderUserExtDTO" resultMap="WorkorderUserExtListVO"> | 
|     SELECT a.* | 
|     FROM `workorder_user` `a` | 
|     <where> | 
|     <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="planId != null"> | 
|       AND `a`.`PLAN_ID` = #{planId} | 
|     </if> | 
|     <if test="workorderId != null"> | 
|       AND `a`.`WORKORDER_ID` = #{workorderId} | 
|     </if> | 
|     <if test="proUserId != null"> | 
|       AND `a`.`PRO_USER_ID` = #{proUserId} | 
|     </if> | 
|     </where> | 
|   </select> | 
|   | 
|   | 
|   <select id="selectListByOrderId" parameterType="doumeemes.dao.ext.dto.QueryWorkorderUserExtDTO" resultMap="WorkorderUserExtListVO"> | 
|     select w.*  , CONCAT(cu.`NAME`,'-',d.`NAME`) as proUserDepartName | 
|     from workorder_user w | 
|     left join company_user cu on w.PRO_USER_ID = cu.USER_ID and cu.DELETED = 0 and cu.ROOT_DEPART_ID = w.ROOT_DEPART_ID | 
|     left join department d on cu.DEPARTMENT_ID = d.id | 
|     <where> | 
|   | 
|       <if test="workorderId != null"> | 
|         AND `w`.`WORKORDER_ID` = #{workorderId} | 
|       </if> | 
|         and  w.deleted = 0 | 
|     </where> | 
|   </select> | 
|   | 
|   | 
|   <select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryWorkorderUserExtDTO" resultMap="WorkorderUserExtListVO"> | 
|     SELECT | 
|       `a`.`ID`, | 
|       `a`.`DELETED`, | 
|       `a`.`CREATE_USER`, | 
|       `a`.`CREATE_TIME`, | 
|       `a`.`UPDATE_USER`, | 
|       `a`.`UPDATE_TIME`, | 
|       `a`.`REMARK`, | 
|       `a`.`ROOT_DEPART_ID`, | 
|       `a`.`DEPART_ID`, | 
|       `a`.`PLAN_ID`, | 
|       `a`.`WORKORDER_ID`, | 
|       `a`.`PRO_USER_ID`, | 
|       `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, | 
|       `pmodel`.`ID` AS PMODEL_ID, | 
|       `pmodel`.`DELETED` AS PMODEL_DELETED, | 
|       `pmodel`.`CREATE_USER` AS PMODEL_CREATE_USER, | 
|       `pmodel`.`CREATE_TIME` AS PMODEL_CREATE_TIME, | 
|       `pmodel`.`UPDATE_USER` AS PMODEL_UPDATE_USER, | 
|       `pmodel`.`UPDATE_TIME` AS PMODEL_UPDATE_TIME, | 
|       `pmodel`.`REMARK` AS PMODEL_REMARK, | 
|       `pmodel`.`ROOT_DEPART_ID` AS PMODEL_ROOT_DEPART_ID, | 
|       `pmodel`.`DEPART_ID` AS PMODEL_DEPART_ID, | 
|       `pmodel`.`ORIGIN` AS PMODEL_ORIGIN, | 
|       `pmodel`.`PLAN_DATE` AS PMODEL_PLAN_DATE, | 
|       `pmodel`.`MATERIAL_ID` AS PMODEL_MATERIAL_ID, | 
|       `pmodel`.`PROCEDURE_ID` AS PMODEL_PROCEDURE_ID, | 
|       `pmodel`.`FACTORY_ID` AS PMODEL_FACTORY_ID, | 
|       `pmodel`.`UNIT_ID` AS PMODEL_UNIT_ID, | 
|       `pmodel`.`NUM` AS PMODEL_NUM, | 
|       `pmodel`.`BATCH` AS PMODEL_BATCH, | 
|       `pmodel`.`URGENT` AS PMODEL_URGENT, | 
|       `pmodel`.`IMPORT_ID` AS PMODEL_IMPORT_ID, | 
|       `pmodel`.`USER_ID` AS PMODEL_USER_ID, | 
|       `pmodel`.`STATUS` AS PMODEL_STATUS, | 
|       `pmodel`.`PUBLISH_DATE` AS PMODEL_PUBLISH_DATE, | 
|       `wmodel`.`ID` AS WMODEL_ID, | 
|       `wmodel`.`DELETED` AS WMODEL_DELETED, | 
|       `wmodel`.`CREATE_USER` AS WMODEL_CREATE_USER, | 
|       `wmodel`.`CREATE_TIME` AS WMODEL_CREATE_TIME, | 
|       `wmodel`.`UPDATE_USER` AS WMODEL_UPDATE_USER, | 
|       `wmodel`.`UPDATE_TIME` AS WMODEL_UPDATE_TIME, | 
|       `wmodel`.`REMARK` AS WMODEL_REMARK, | 
|       `wmodel`.`ROOT_DEPART_ID` AS WMODEL_ROOT_DEPART_ID, | 
|       `wmodel`.`DEPART_ID` AS WMODEL_DEPART_ID, | 
|       `wmodel`.`PLAN_ID` AS WMODEL_PLAN_ID, | 
|       `wmodel`.`FACTORY_ID` AS WMODEL_FACTORY_ID, | 
|       `wmodel`.`PROCEDURE_ID` AS WMODEL_PROCEDURE_ID, | 
|       `wmodel`.`CODE` AS WMODEL_CODE, | 
|       `wmodel`.`ORIGIN_WORKORDER_ID` AS WMODEL_ORIGIN_WORKORDER_ID, | 
|       `wmodel`.`TYPE_ID` AS WMODEL_TYPE_ID, | 
|       `wmodel`.`ORIGIN_ID` AS WMODEL_ORIGIN_ID, | 
|       `wmodel`.`PLAN_DATE` AS WMODEL_PLAN_DATE, | 
|       `wmodel`.`PLAN_NUM` AS WMODEL_PLAN_NUM, | 
|       `wmodel`.`MATERIAL_ID` AS WMODEL_MATERIAL_ID, | 
|       `wmodel`.`UNIT_ID` AS WMODEL_UNIT_ID, | 
|       `wmodel`.`BATCH` AS WMODEL_BATCH, | 
|       `wmodel`.`PRO_USER_ID` AS WMODEL_PRO_USER_ID, | 
|       `wmodel`.`PRO_GROUP_ID` AS WMODEL_PRO_GROUP_ID, | 
|       `wmodel`.`QUALIFIED_NUM` AS WMODEL_QUALIFIED_NUM, | 
|       `wmodel`.`UNQUALIFIED_NUM` AS WMODEL_UNQUALIFIED_NUM, | 
|       `wmodel`.`CHECK_USER_ID` AS WMODEL_CHECK_USER_ID, | 
|       `wmodel`.`STATUS` AS WMODEL_STATUS, | 
|       `wmodel`.`LAST_DEAL_DATE` AS WMODEL_LAST_DEAL_DATE, | 
|       `wmodel`.`LAST_DEAL_INFO` AS WMODEL_LAST_DEAL_INFO, | 
|       `wmodel`.`URGENT` AS WMODEL_URGENT, | 
|       `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 | 
|     FROM `workorder_user` `a` | 
|     LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID | 
|     LEFT JOIN `plans` `pmodel` ON a.PLAN_ID=pmodel.ID | 
|     LEFT JOIN `workorder` `wmodel` ON a.WORKORDER_ID=b.ID | 
|     LEFT JOIN `system_user` `umodel` ON a.PRO_USER_ID=umodel.ID | 
|     <where> | 
|     <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="planId != null"> | 
|       AND `a`.`PLAN_ID` = #{planId} | 
|     </if> | 
|     <if test="workorderId != null"> | 
|       AND `a`.`WORKORDER_ID` = #{workorderId} | 
|     </if> | 
|     <if test="proUserId != null"> | 
|       AND `a`.`PRO_USER_ID` = #{proUserId} | 
|     </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="pmodelId != null"> | 
|         AND `pmodel`.`ID` = #{pmodelId} | 
|       </if> | 
|       <if test="pmodelDeleted != null"> | 
|         AND `pmodel`.`DELETED` = #{pmodelDeleted} | 
|       </if> | 
|       <if test="pmodelCreateUser != null"> | 
|         AND `pmodel`.`CREATE_USER` = #{pmodelCreateUser} | 
|       </if> | 
|       <if test="pmodelCreateTime != null"> | 
|         AND `pmodel`.`CREATE_TIME` = #{pmodelCreateTime} | 
|       </if> | 
|       <if test="pmodelUpdateUser != null"> | 
|         AND `pmodel`.`UPDATE_USER` = #{pmodelUpdateUser} | 
|       </if> | 
|       <if test="pmodelUpdateTime != null"> | 
|         AND `pmodel`.`UPDATE_TIME` = #{pmodelUpdateTime} | 
|       </if> | 
|       <if test="pmodelRemark != null and pmodelRemark != ''"> | 
|         AND `pmodel`.`REMARK` = #{pmodelRemark} | 
|       </if> | 
|       <if test="pmodelRootDepartId != null"> | 
|         AND `pmodel`.`ROOT_DEPART_ID` = #{pmodelRootDepartId} | 
|       </if> | 
|       <if test="pmodelDepartId != null"> | 
|         AND `pmodel`.`DEPART_ID` = #{pmodelDepartId} | 
|       </if> | 
|       <if test="pmodelOrigin != null"> | 
|         AND `pmodel`.`ORIGIN` = #{pmodelOrigin} | 
|       </if> | 
|       <if test="pmodelPlanDate != null"> | 
|         AND `pmodel`.`PLAN_DATE` = #{pmodelPlanDate} | 
|       </if> | 
|       <if test="pmodelMaterialId != null"> | 
|         AND `pmodel`.`MATERIAL_ID` = #{pmodelMaterialId} | 
|       </if> | 
|       <if test="pmodelProcedureId != null"> | 
|         AND `pmodel`.`PROCEDURE_ID` = #{pmodelProcedureId} | 
|       </if> | 
|       <if test="pmodelFactoryId != null"> | 
|         AND `pmodel`.`FACTORY_ID` = #{pmodelFactoryId} | 
|       </if> | 
|       <if test="pmodelUnitId != null"> | 
|         AND `pmodel`.`UNIT_ID` = #{pmodelUnitId} | 
|       </if> | 
|       <if test="pmodelNum != null"> | 
|         AND `pmodel`.`NUM` = #{pmodelNum} | 
|       </if> | 
|       <if test="pmodelBatch != null and pmodelBatch != ''"> | 
|         AND `pmodel`.`BATCH` = #{pmodelBatch} | 
|       </if> | 
|       <if test="pmodelUrgent != null"> | 
|         AND `pmodel`.`URGENT` = #{pmodelUrgent} | 
|       </if> | 
|       <if test="pmodelImportId != null"> | 
|         AND `pmodel`.`IMPORT_ID` = #{pmodelImportId} | 
|       </if> | 
|       <if test="pmodelUserId != null"> | 
|         AND `pmodel`.`USER_ID` = #{pmodelUserId} | 
|       </if> | 
|       <if test="pmodelStatus != null"> | 
|         AND `pmodel`.`STATUS` = #{pmodelStatus} | 
|       </if> | 
|       <if test="pmodelPublishDate != null"> | 
|         AND `pmodel`.`PUBLISH_DATE` = #{pmodelPublishDate} | 
|       </if> | 
|       <if test="wmodelId != null"> | 
|         AND `wmodel`.`ID` = #{wmodelId} | 
|       </if> | 
|       <if test="wmodelDeleted != null"> | 
|         AND `wmodel`.`DELETED` = #{wmodelDeleted} | 
|       </if> | 
|       <if test="wmodelCreateUser != null"> | 
|         AND `wmodel`.`CREATE_USER` = #{wmodelCreateUser} | 
|       </if> | 
|       <if test="wmodelCreateTime != null"> | 
|         AND `wmodel`.`CREATE_TIME` = #{wmodelCreateTime} | 
|       </if> | 
|       <if test="wmodelUpdateUser != null"> | 
|         AND `wmodel`.`UPDATE_USER` = #{wmodelUpdateUser} | 
|       </if> | 
|       <if test="wmodelUpdateTime != null"> | 
|         AND `wmodel`.`UPDATE_TIME` = #{wmodelUpdateTime} | 
|       </if> | 
|       <if test="wmodelRemark != null and wmodelRemark != ''"> | 
|         AND `wmodel`.`REMARK` = #{wmodelRemark} | 
|       </if> | 
|       <if test="wmodelRootDepartId != null"> | 
|         AND `wmodel`.`ROOT_DEPART_ID` = #{wmodelRootDepartId} | 
|       </if> | 
|       <if test="wmodelDepartId != null"> | 
|         AND `wmodel`.`DEPART_ID` = #{wmodelDepartId} | 
|       </if> | 
|       <if test="wmodelPlanId != null"> | 
|         AND `wmodel`.`PLAN_ID` = #{wmodelPlanId} | 
|       </if> | 
|       <if test="wmodelFactoryId != null"> | 
|         AND `wmodel`.`FACTORY_ID` = #{wmodelFactoryId} | 
|       </if> | 
|       <if test="wmodelProcedureId != null"> | 
|         AND `wmodel`.`PROCEDURE_ID` = #{wmodelProcedureId} | 
|       </if> | 
|       <if test="wmodelCode != null and wmodelCode != ''"> | 
|         AND `wmodel`.`CODE` = #{wmodelCode} | 
|       </if> | 
|       <if test="wmodelOriginWorkorderId != null"> | 
|         AND `wmodel`.`ORIGIN_WORKORDER_ID` = #{wmodelOriginWorkorderId} | 
|       </if> | 
|       <if test="wmodelTypeId != null"> | 
|         AND `wmodel`.`TYPE_ID` = #{wmodelTypeId} | 
|       </if> | 
|       <if test="wmodelOriginId != null"> | 
|         AND `wmodel`.`ORIGIN_ID` = #{wmodelOriginId} | 
|       </if> | 
|       <if test="wmodelPlanDate != null"> | 
|         AND `wmodel`.`PLAN_DATE` = #{wmodelPlanDate} | 
|       </if> | 
|       <if test="wmodelPlanNum != null"> | 
|         AND `wmodel`.`PLAN_NUM` = #{wmodelPlanNum} | 
|       </if> | 
|       <if test="wmodelMaterialId != null"> | 
|         AND `wmodel`.`MATERIAL_ID` = #{wmodelMaterialId} | 
|       </if> | 
|       <if test="wmodelUnitId != null"> | 
|         AND `wmodel`.`UNIT_ID` = #{wmodelUnitId} | 
|       </if> | 
|       <if test="wmodelBatch != null and wmodelBatch != ''"> | 
|         AND `wmodel`.`BATCH` = #{wmodelBatch} | 
|       </if> | 
|       <if test="wmodelProUserId != null"> | 
|         AND `wmodel`.`PRO_USER_ID` = #{wmodelProUserId} | 
|       </if> | 
|       <if test="wmodelProGroupId != null"> | 
|         AND `wmodel`.`PRO_GROUP_ID` = #{wmodelProGroupId} | 
|       </if> | 
|       <if test="wmodelQualifiedNum != null"> | 
|         AND `wmodel`.`QUALIFIED_NUM` = #{wmodelQualifiedNum} | 
|       </if> | 
|       <if test="wmodelUnqualifiedNum != null"> | 
|         AND `wmodel`.`UNQUALIFIED_NUM` = #{wmodelUnqualifiedNum} | 
|       </if> | 
|       <if test="wmodelCheckUserId != null"> | 
|         AND `wmodel`.`CHECK_USER_ID` = #{wmodelCheckUserId} | 
|       </if> | 
|       <if test="wmodelStatus != null"> | 
|         AND `wmodel`.`STATUS` = #{wmodelStatus} | 
|       </if> | 
|       <if test="wmodelLastDealDate != null"> | 
|         AND `wmodel`.`LAST_DEAL_DATE` = #{wmodelLastDealDate} | 
|       </if> | 
|       <if test="wmodelLastDealInfo != null and wmodelLastDealInfo != ''"> | 
|         AND `wmodel`.`LAST_DEAL_INFO` = #{wmodelLastDealInfo} | 
|       </if> | 
|       <if test="wmodelUrgent != null"> | 
|         AND `wmodel`.`URGENT` = #{wmodelUrgent} | 
|       </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`.`USERNAME` = #{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> | 
|     </where> | 
|   </select> | 
| </mapper> |