| <?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.WOutboundRecordExtMapper"> | 
|   | 
|   <!-- 管理页面查询 --> | 
|   <resultMap id="WOutboundRecordExtListVO" type="doumeemes.dao.ext.vo.WOutboundRecordExtListVO" 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="mmodel" javaType="doumeemes.dao.business.model.Material"> | 
|       <id column="MMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|       <result column="MMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|       <result column="MMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|       <result column="MMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|       <result column="MMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|       <result column="MMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|       <result column="MMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="MMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="MMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|       <result column="MMODEL_CODE" jdbcType="VARCHAR" property="code"/> | 
|       <result column="MMODEL_ATTR" jdbcType="VARCHAR" property="attr"/> | 
|       <result column="MMODEL_UNION_NAME" jdbcType="VARCHAR" property="unionName"/> | 
|       <result column="MMODEL_UNIT_ID" jdbcType="INTEGER" property="unitId"/> | 
|       <result column="MMODEL_CATE_UNION_ID" jdbcType="INTEGER" property="cateUnionId"/> | 
|       <result column="MMODEL_FORMATION" jdbcType="TINYINT" property="formation"/> | 
|       <result column="MMODEL_QRCODE_ID" jdbcType="VARCHAR" property="qrcodeId"/> | 
|       <result column="MMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|       <result column="MMODEL_VALID_TIME" jdbcType="TIMESTAMP" property="validTime"/> | 
|       <result column="MMODEL_INVALID_TIME" jdbcType="TIMESTAMP" property="invalidTime"/> | 
|       <result column="MMODEL_CHECK_WAY" jdbcType="TINYINT" property="checkWay"/> | 
|       <result column="MMODEL_QUALITY_REQUIRE" jdbcType="VARCHAR" property="qualityRequire"/> | 
|       <result column="MMODEL_CHECK_NOTE" jdbcType="VARCHAR" property="checkNote"/> | 
|     </association> | 
|     <association property="umodel" javaType="doumeemes.dao.business.model.Unit"> | 
|       <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_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="UMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="UMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|       <result column="UMODEL_TYPE" jdbcType="TINYINT" property="type"/> | 
|       <result column="UMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|     </association> | 
|     <association property="wmodel" javaType="doumeemes.dao.business.model.Warehouse"> | 
|       <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_PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/> | 
|       <result column="WMODEL_QRCODE" jdbcType="INTEGER" property="qrcode"/> | 
|       <result column="WMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|       <result column="WMODEL_USE_LOCATION" jdbcType="TINYINT" property="useLocation"/> | 
|       <result column="WMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|       <result column="WMODEL_ADDR" jdbcType="VARCHAR" property="addr"/> | 
|     </association> | 
|   </resultMap> | 
|   <select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryWOutboundRecordExtDTO" resultMap="WOutboundRecordExtListVO"> | 
|     SELECT | 
|       `wOutboundRecord`.`ID`, | 
|       `wOutboundRecord`.`DELETED`, | 
|       `wOutboundRecord`.`CREATE_USER`, | 
|       `wOutboundRecord`.`CREATE_TIME`, | 
|       `wOutboundRecord`.`UPDATE_USER`, | 
|       `wOutboundRecord`.`UPDATE_TIME`, | 
|       `wOutboundRecord`.`REMARK`, | 
|       `wOutboundRecord`.`ROOT_DEPART_ID`, | 
|       `wOutboundRecord`.`OUTBOUND_ID`, | 
|       `wOutboundRecord`.`DETAIL_ID`, | 
|       `wOutboundRecord`.`MATERIAL_ID`, | 
|       `wOutboundRecord`.`UNIT_ID`, | 
|       `wOutboundRecord`.`WAREHOUSE_ID`, | 
|       `wOutboundRecord`.`BATCH`, | 
|       `wOutboundRecord`.`NUM`, | 
|       `wOutboundRecord`.`CANCELED`, | 
|       `wOutboundRecord`.`CANCEL_DATE`, | 
|       `wOutboundRecord`.`CANCEL_INFO`, | 
|       `wOutboundRecord`.`CANCEL_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, | 
|       `mmodel`.`ID` AS MMODEL_ID, | 
|       `mmodel`.`DELETED` AS MMODEL_DELETED, | 
|       `mmodel`.`CREATE_USER` AS MMODEL_CREATE_USER, | 
|       `mmodel`.`CREATE_TIME` AS MMODEL_CREATE_TIME, | 
|       `mmodel`.`UPDATE_USER` AS MMODEL_UPDATE_USER, | 
|       `mmodel`.`UPDATE_TIME` AS MMODEL_UPDATE_TIME, | 
|       `mmodel`.`REMARK` AS MMODEL_REMARK, | 
|       `mmodel`.`ROOT_DEPART_ID` AS MMODEL_ROOT_DEPART_ID, | 
|       `mmodel`.`NAME` AS MMODEL_NAME, | 
|       `mmodel`.`CODE` AS MMODEL_CODE, | 
|       `mmodel`.`ATTR` AS MMODEL_ATTR, | 
|       `mmodel`.`UNION_NAME` AS MMODEL_UNION_NAME, | 
|       `mmodel`.`UNIT_ID` AS MMODEL_UNIT_ID, | 
|       `mmodel`.`CATE_UNION_ID` AS MMODEL_CATE_UNION_ID, | 
|       `mmodel`.`FORMATION` AS MMODEL_FORMATION, | 
|       `mmodel`.`QRCODE_ID` AS MMODEL_QRCODE_ID, | 
|       `mmodel`.`STATUS` AS MMODEL_STATUS, | 
|       `mmodel`.`VALID_TIME` AS MMODEL_VALID_TIME, | 
|       `mmodel`.`INVALID_TIME` AS MMODEL_INVALID_TIME, | 
|       `mmodel`.`CHECK_WAY` AS MMODEL_CHECK_WAY, | 
|       `mmodel`.`QUALITY_REQUIRE` AS MMODEL_QUALITY_REQUIRE, | 
|       `mmodel`.`CHECK_NOTE` AS MMODEL_CHECK_NOTE, | 
|       `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`.`REMARK` AS UMODEL_REMARK, | 
|       `umodel`.`ROOT_DEPART_ID` AS UMODEL_ROOT_DEPART_ID, | 
|       `umodel`.`NAME` AS UMODEL_NAME, | 
|       `umodel`.`TYPE` AS UMODEL_TYPE, | 
|       `umodel`.`STATUS` AS UMODEL_STATUS, | 
|       `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`.`PROCEDURE_ID` AS WMODEL_PROCEDURE_ID, | 
|       `wmodel`.`QRCODE` AS WMODEL_QRCODE, | 
|       `wmodel`.`NAME` AS WMODEL_NAME, | 
|       `wmodel`.`USE_LOCATION` AS WMODEL_USE_LOCATION, | 
|       `wmodel`.`STATUS` AS WMODEL_STATUS, | 
|       `wmodel`.`ADDR` AS WMODEL_ADDR | 
|     FROM `w_outbound_record` `wOutboundRecord` | 
|     LEFT JOIN `department` `dmodel` ON a.DETAIL_ID=dmodel.ID | 
|     LEFT JOIN `material` `mmodel` ON a.MATERIAL_ID=mmodel.ID | 
|     LEFT JOIN `unit` `umodel` ON a.UNIT_ID=umodel.ID | 
|     LEFT JOIN `warehouse` `wmodel` ON a.WAREHOUSE_ID=wmodel.ID | 
|     <where> | 
|       <if test="id != null"> | 
|         AND `wOutboundRecord`.`ID` = #{id} | 
|       </if> | 
|       <if test="deleted != null"> | 
|         AND `wOutboundRecord`.`DELETED` = #{deleted} | 
|       </if> | 
|       <if test="createUser != null"> | 
|         AND `wOutboundRecord`.`CREATE_USER` = #{createUser} | 
|       </if> | 
|       <if test="createTime != null"> | 
|         AND `wOutboundRecord`.`CREATE_TIME` = #{createTime} | 
|       </if> | 
|       <if test="updateUser != null"> | 
|         AND `wOutboundRecord`.`UPDATE_USER` = #{updateUser} | 
|       </if> | 
|       <if test="updateTime != null"> | 
|         AND `wOutboundRecord`.`UPDATE_TIME` = #{updateTime} | 
|       </if> | 
|       <if test="remark != null and remark != ''"> | 
|         AND `wOutboundRecord`.`REMARK` = #{remark} | 
|       </if> | 
|       <if test="rootDepartId != null"> | 
|         AND `wOutboundRecord`.`ROOT_DEPART_ID` = #{rootDepartId} | 
|       </if> | 
|       <if test="outboundId != null"> | 
|         AND `wOutboundRecord`.`OUTBOUND_ID` = #{outboundId} | 
|       </if> | 
|       <if test="detailId != null"> | 
|         AND `wOutboundRecord`.`DETAIL_ID` = #{detailId} | 
|       </if> | 
|       <if test="materialId != null"> | 
|         AND `wOutboundRecord`.`MATERIAL_ID` = #{materialId} | 
|       </if> | 
|       <if test="unitId != null"> | 
|         AND `wOutboundRecord`.`UNIT_ID` = #{unitId} | 
|       </if> | 
|       <if test="warehouseId != null"> | 
|         AND `wOutboundRecord`.`WAREHOUSE_ID` = #{warehouseId} | 
|       </if> | 
|       <if test="batch != null and batch != ''"> | 
|         AND `wOutboundRecord`.`BATCH` = #{batch} | 
|       </if> | 
|       <if test="num != null"> | 
|         AND `wOutboundRecord`.`NUM` = #{num} | 
|       </if> | 
|       <if test="canceled != null"> | 
|         AND `wOutboundRecord`.`CANCELED` = #{canceled} | 
|       </if> | 
|       <if test="cancelDate != null"> | 
|         AND `wOutboundRecord`.`CANCEL_DATE` = #{cancelDate} | 
|       </if> | 
|       <if test="cancelInfo != null and cancelInfo != ''"> | 
|         AND `wOutboundRecord`.`CANCEL_INFO` = #{cancelInfo} | 
|       </if> | 
|       <if test="cancelUserId != null"> | 
|         AND `wOutboundRecord`.`CANCEL_USER_ID` = #{cancelUserId} | 
|       </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="mmodelId != null"> | 
|         AND `mmodel`.`ID` = #{mmodelId} | 
|       </if> | 
|       <if test="mmodelDeleted != null"> | 
|         AND `mmodel`.`DELETED` = #{mmodelDeleted} | 
|       </if> | 
|       <if test="mmodelCreateUser != null"> | 
|         AND `mmodel`.`CREATE_USER` = #{mmodelCreateUser} | 
|       </if> | 
|       <if test="mmodelCreateTime != null"> | 
|         AND `mmodel`.`CREATE_TIME` = #{mmodelCreateTime} | 
|       </if> | 
|       <if test="mmodelUpdateUser != null"> | 
|         AND `mmodel`.`UPDATE_USER` = #{mmodelUpdateUser} | 
|       </if> | 
|       <if test="mmodelUpdateTime != null"> | 
|         AND `mmodel`.`UPDATE_TIME` = #{mmodelUpdateTime} | 
|       </if> | 
|       <if test="mmodelRemark != null and mmodelRemark != ''"> | 
|         AND `mmodel`.`REMARK` = #{mmodelRemark} | 
|       </if> | 
|       <if test="mmodelRootDepartId != null"> | 
|         AND `mmodel`.`ROOT_DEPART_ID` = #{mmodelRootDepartId} | 
|       </if> | 
|       <if test="mmodelName != null and mmodelName != ''"> | 
|         AND `mmodel`.`NAME` = #{mmodelName} | 
|       </if> | 
|       <if test="mmodelCode != null and mmodelCode != ''"> | 
|         AND `mmodel`.`CODE` = #{mmodelCode} | 
|       </if> | 
|       <if test="mmodelAttr != null and mmodelAttr != ''"> | 
|         AND `mmodel`.`ATTR` = #{mmodelAttr} | 
|       </if> | 
|       <if test="mmodelUnionName != null and mmodelUnionName != ''"> | 
|         AND `mmodel`.`UNION_NAME` = #{mmodelUnionName} | 
|       </if> | 
|       <if test="mmodelUnitId != null"> | 
|         AND `mmodel`.`UNIT_ID` = #{mmodelUnitId} | 
|       </if> | 
|       <if test="mmodelCateUnionId != null"> | 
|         AND `mmodel`.`CATE_UNION_ID` = #{mmodelCateUnionId} | 
|       </if> | 
|       <if test="mmodelFormation != null"> | 
|         AND `mmodel`.`FORMATION` = #{mmodelFormation} | 
|       </if> | 
|       <if test="mmodelQrcodeId != null and mmodelQrcodeId != ''"> | 
|         AND `mmodel`.`QRCODE_ID` = #{mmodelQrcodeId} | 
|       </if> | 
|       <if test="mmodelStatus != null"> | 
|         AND `mmodel`.`STATUS` = #{mmodelStatus} | 
|       </if> | 
|       <if test="mmodelValidTime != null"> | 
|         AND `mmodel`.`VALID_TIME` = #{mmodelValidTime} | 
|       </if> | 
|       <if test="mmodelInvalidTime != null"> | 
|         AND `mmodel`.`INVALID_TIME` = #{mmodelInvalidTime} | 
|       </if> | 
|       <if test="mmodelCheckWay != null"> | 
|         AND `mmodel`.`CHECK_WAY` = #{mmodelCheckWay} | 
|       </if> | 
|       <if test="mmodelQualityRequire != null and mmodelQualityRequire != ''"> | 
|         AND `mmodel`.`QUALITY_REQUIRE` = #{mmodelQualityRequire} | 
|       </if> | 
|       <if test="mmodelCheckNote != null and mmodelCheckNote != ''"> | 
|         AND `mmodel`.`CHECK_NOTE` = #{mmodelCheckNote} | 
|       </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="umodelRemark != null and umodelRemark != ''"> | 
|         AND `umodel`.`REMARK` = #{umodelRemark} | 
|       </if> | 
|       <if test="umodelRootDepartId != null"> | 
|         AND `umodel`.`ROOT_DEPART_ID` = #{umodelRootDepartId} | 
|       </if> | 
|       <if test="umodelName != null and umodelName != ''"> | 
|         AND `umodel`.`NAME` = #{umodelName} | 
|       </if> | 
|       <if test="umodelType != null"> | 
|         AND `umodel`.`TYPE` = #{umodelType} | 
|       </if> | 
|       <if test="umodelStatus != null"> | 
|         AND `umodel`.`STATUS` = #{umodelStatus} | 
|       </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="wmodelProcedureId != null"> | 
|         AND `wmodel`.`PROCEDURE_ID` = #{wmodelProcedureId} | 
|       </if> | 
|       <if test="wmodelQrcode != null"> | 
|         AND `wmodel`.`QRCODE` = #{wmodelQrcode} | 
|       </if> | 
|       <if test="wmodelName != null and wmodelName != ''"> | 
|         AND `wmodel`.`NAME` = #{wmodelName} | 
|       </if> | 
|       <if test="wmodelUseLocation != null"> | 
|         AND `wmodel`.`USE_LOCATION` = #{wmodelUseLocation} | 
|       </if> | 
|       <if test="wmodelStatus != null"> | 
|         AND `wmodel`.`STATUS` = #{wmodelStatus} | 
|       </if> | 
|       <if test="wmodelAddr != null and wmodelAddr != ''"> | 
|         AND `wmodel`.`ADDR` = #{wmodelAddr} | 
|       </if> | 
|     </where> | 
|   </select> | 
|   | 
|   | 
|   | 
|   <insert id="insertBatch"  > | 
|     insert into `w_outbound_detail` ( | 
|     `ID`, | 
|     `DELETED`, | 
|     `CREATE_USER`, | 
|     `CREATE_TIME`, | 
|     `UPDATE_USER`, | 
|     `UPDATE_TIME`, | 
|     `REMARK`, | 
|     `ROOT_DEPART_ID`, | 
|     `OUTBOUND_ID`, | 
|     `DETAIL_ID`, | 
|     `MATERIAL_ID`, | 
|     `UNIT_ID`, | 
|     `WAREHOUSE_ID`, | 
|     `BATCH`, | 
|     `NUM`, | 
|     `CANCELED`, | 
|     `CANCEL_DATE`, | 
|     `CANCEL_INFO`, | 
|     `CANCEL_USER_ID`, | 
|     `APPLIANCES_ID` | 
|     ) | 
|     values | 
|     <foreach collection="list" separator="," item="item"> | 
|       ( | 
|       #{item.id}, | 
|       #{item.deleted}, | 
|       #{item.createUser}, | 
|       #{item.createTime}, | 
|       #{item.updateUser}, | 
|       #{item.updateTime}, | 
|       #{item.remark}, | 
|       #{item.rootDepartId}, | 
|       #{item.outboundId}, | 
|       #{item.detailId}, | 
|       #{item.materialId}, | 
|       #{item.unitId}, | 
|       #{item.warehouseId}, | 
|       #{item.batch}, | 
|       #{item.num}, | 
|       #{item.canceled}, | 
|       #{item.cancelDate}, | 
|       #{item.cancelInfo}, | 
|       #{item.cancelUserId}, | 
|       #{item.appliancesId} | 
|       ) | 
|     </foreach> | 
|   </insert> | 
|   | 
|   <select id="getWOutboundRecordAp"  resultType="doumeemes.dao.ext.bean.EndCheckApBean"> | 
|     SELECT | 
|     wr.APPLIANCES_ID  as appliancesId , wr.NUM as appliancesNum, | 
|     a.`CODE` as appliancesCode ,wr.WORKORDER_ID as workOrderId | 
|     FROM | 
|     workorder_record wr | 
|     LEFT JOIN appliances a ON wr.APPLIANCES_ID = a.id | 
|     <where> | 
|       <if test="workOrderId != null"> | 
|         AND wr.WORKORDER_ID = #{workOrderId} | 
|       </if> | 
|       <if test="appliancesId != null"> | 
|         AND wr.APPLIANCES_ID = #{appliancesId} | 
|       </if> | 
|     </where> | 
|     limit 1 | 
|   </select> | 
|   | 
|   | 
|   | 
|   <select id="recordCodeList"  resultType="doumeemes.dao.ext.vo.WOutboundRecordCodeListVO"> | 
|     select | 
|         substr(w2.PLAN_DATE,1,10)  as billDate , m2.code as materialCode , m2.`NAME` as materialName ,w1.BATCH , p1.`NAME` as produceName , | 
|       w1.QUALITY_TYPE  , w1.NUM , a1.code as appliancesCode , w2.TYPE ,w3.`NAME` as warehouseName , w4.UNION_NAME as locationName , | 
|       w2.code as billNO, w2.BILL_TYPE as billType , c1.`NAME` as createUserName , w2.CREATE_TIME as createTime , u1.`NAME` as unitName | 
|     from w_outbound_record w1 | 
|     inner join w_outbound w2 on w1.OUTBOUND_ID = w2.ID and w2.DELETED = 0 | 
|     inner join material_distribute m1 on w1.MATERIAL_ID = m1.ID  and m1.DELETED = 0 | 
|     inner join material m2 on m1.MATERIAL_ID = m2.ID and m2.DELETED = 0 | 
|     inner join unit u1 on m2.UNIT_ID = u1.id and u1.DELETED = 0 | 
|     inner join warehouse w3 on w1.WAREHOUSE_ID = w3.ID  and w3.DELETED = 0 | 
|     inner join warehouse_location w4 on w1.LOCATION_ID = w4.ID and w4.DELETED = 0 | 
|     inner join procedures p1 on w1.PROCEDURE_ID = p1.ID and p1.DELETED = 0 | 
|     inner join appliances a1 on w1.APPLIANCES_ID = a1.ID and a1.DELETED = 0 | 
|     inner join `system_user` s1 on w2.CREATE_USER = s1.ID and s1.DELETED = 0 | 
|     inner join company_user c1 on s1.id = c1.USER_ID    and c1.DELETED = 0 | 
|     <where> | 
|       <if test="appliancesCode != null and appliancesCode != ''"> | 
|         AND a1.code  like CONCAT('%',#{appliancesCode},'%') | 
|       </if> | 
|       <if test="materialCode != null and materialCode != ''"> | 
|         AND m2.code  like CONCAT('%',#{materialCode},'%') | 
|       </if> | 
|       <if test="produceName != null and produceName != ''"> | 
|         AND p1.name like CONCAT('%',#{produceName},'%') | 
|       </if> | 
|       <if test="batch != null and batch != ''"> | 
|         AND w1.batch like CONCAT('%',#{batch},'%') | 
|       </if> | 
|       <if test="type != null"> | 
|         AND w2.type  = #{type} | 
|       </if> | 
|       <if test="warehouseId != null "> | 
|         AND w1.WAREHOUSE_ID  = #{warehouseId} | 
|       </if> | 
|       <if test="locationId != null "> | 
|         AND w1.LOCATION_ID  = #{locationId} | 
|       </if> | 
|       <if test="billNO != null and billNO != ''"> | 
|         AND w2.code like CONCAT('%',#{billNO},'%') | 
|       </if> | 
|       <if test="billType != null"> | 
|         AND w2.bill_type  = #{billType} | 
|       </if> | 
|       <if test="qualityType != null "> | 
|         AND w1.QUALITY_TYPE  = #{qualityType} | 
|       </if> | 
|       <if test="beginDate != null and beginDate != '' "> | 
|         AND `w2`.`VALID_DATE` >= CONCAT(#{beginDate},' 00:00:00') | 
|       </if> | 
|       <if test="endDate != null and endDate != '' "> | 
|         AND CONCAT(#{endDate},' 23:59:59') >= `w2`.`VALID_DATE` | 
|       </if> | 
|     </where> | 
|     order by w1.CREATE_TIME desc | 
|   </select> | 
|   | 
|   | 
|   | 
|   | 
|   | 
| </mapper> |