| <?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.WHistoryExtMapper"> | 
|   | 
|   <!-- 管理页面查询 --> | 
|   <resultMap id="WHistoryExtListVO" type="doumeemes.dao.ext.vo.WHistoryExtListVO" 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="omodel" javaType="doumeemes.dao.business.model.Salesorder"> | 
|       <id column="OMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|       <result column="OMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|       <result column="OMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|       <result column="OMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|       <result column="OMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|       <result column="OMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|       <result column="OMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="OMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="OMODEL_DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|       <result column="OMODEL_CUSTOMER_ID" jdbcType="INTEGER" property="customerId"/> | 
|       <result column="OMODEL_CODE" jdbcType="VARCHAR" property="code"/> | 
|       <result column="OMODEL_CUSTOMER_CATE" jdbcType="VARCHAR" property="customerCate"/> | 
|       <result column="OMODEL_AREA" jdbcType="VARCHAR" property="area"/> | 
|       <result column="OMODEL_SALE_USER_ID" jdbcType="INTEGER" property="saleUserId"/> | 
|       <result column="OMODEL_ORIGIN" jdbcType="TINYINT" property="origin"/> | 
|       <result column="OMODEL_TYPE" jdbcType="TINYINT" property="type"/> | 
|       <result column="OMODEL_ORDER_DATE" jdbcType="TIMESTAMP" property="orderDate"/> | 
|       <result column="OMODEL_AMOUNT" jdbcType="INTEGER" property="amount"/> | 
|       <result column="OMODEL_URGENT" jdbcType="TINYINT" property="urgent"/> | 
|       <result column="OMODEL_ORIGIN_ORDER_ID" jdbcType="INTEGER" property="originOrderId"/> | 
|       <result column="OMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|     </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="selectList" parameterType="doumeemes.dao.ext.dto.QueryWHistoryExtDTO" resultMap="WHistoryExtListVO"> | 
|     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`.`ORDER_TYPE`, | 
|       `a`.`ORDER_ID`, | 
|       `a`.`USER_ID`, | 
|       `a`.`TITLE`, | 
|       `a`.`INFO`, | 
|       `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, | 
|       `omodel`.`ID` AS OMODEL_ID, | 
|       `omodel`.`DELETED` AS OMODEL_DELETED, | 
|       `omodel`.`CREATE_USER` AS OMODEL_CREATE_USER, | 
|       `omodel`.`CREATE_TIME` AS OMODEL_CREATE_TIME, | 
|       `omodel`.`UPDATE_USER` AS OMODEL_UPDATE_USER, | 
|       `omodel`.`UPDATE_TIME` AS OMODEL_UPDATE_TIME, | 
|       `omodel`.`REMARK` AS OMODEL_REMARK, | 
|       `omodel`.`ROOT_DEPART_ID` AS OMODEL_ROOT_DEPART_ID, | 
|       `omodel`.`DEPART_ID` AS OMODEL_DEPART_ID, | 
|       `omodel`.`CUSTOMER_ID` AS OMODEL_CUSTOMER_ID, | 
|       `omodel`.`CODE` AS OMODEL_CODE, | 
|       `omodel`.`CUSTOMER_CATE` AS OMODEL_CUSTOMER_CATE, | 
|       `omodel`.`AREA` AS OMODEL_AREA, | 
|       `omodel`.`SALE_USER_ID` AS OMODEL_SALE_USER_ID, | 
|       `omodel`.`ORIGIN` AS OMODEL_ORIGIN, | 
|       `omodel`.`TYPE` AS OMODEL_TYPE, | 
|       `omodel`.`ORDER_DATE` AS OMODEL_ORDER_DATE, | 
|       `omodel`.`AMOUNT` AS OMODEL_AMOUNT, | 
|       `omodel`.`URGENT` AS OMODEL_URGENT, | 
|       `omodel`.`ORIGIN_ORDER_ID` AS OMODEL_ORIGIN_ORDER_ID, | 
|       `omodel`.`STATUS` AS OMODEL_STATUS, | 
|       `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 `w_history` `a` | 
|     LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID | 
|     LEFT JOIN `salesorder` `omodel` ON a.ORDER_ID=omodel.ID | 
|     LEFT JOIN `system_user` `umodel` ON a.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="orderType != null"> | 
|         AND `a`.`ORDER_TYPE` = #{orderType} | 
|       </if> | 
|       <if test="orderId != null"> | 
|         AND `a`.`ORDER_ID` = #{orderId} | 
|       </if> | 
|       <if test="userId != null"> | 
|         AND `a`.`USER_ID` = #{userId} | 
|       </if> | 
|       <if test="title != null and title != ''"> | 
|         AND `a`.`TITLE` = #{title} | 
|       </if> | 
|       <if test="info != null and info != ''"> | 
|         AND `a`.`INFO` = #{info} | 
|       </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="omodelId != null"> | 
|         AND `omodel`.`ID` = #{omodelId} | 
|       </if> | 
|       <if test="omodelDeleted != null"> | 
|         AND `omodel`.`DELETED` = #{omodelDeleted} | 
|       </if> | 
|       <if test="omodelCreateUser != null"> | 
|         AND `omodel`.`CREATE_USER` = #{omodelCreateUser} | 
|       </if> | 
|       <if test="omodelCreateTime != null"> | 
|         AND `omodel`.`CREATE_TIME` = #{omodelCreateTime} | 
|       </if> | 
|       <if test="omodelUpdateUser != null"> | 
|         AND `omodel`.`UPDATE_USER` = #{omodelUpdateUser} | 
|       </if> | 
|       <if test="omodelUpdateTime != null"> | 
|         AND `omodel`.`UPDATE_TIME` = #{omodelUpdateTime} | 
|       </if> | 
|       <if test="omodelRemark != null and omodelRemark != ''"> | 
|         AND `omodel`.`REMARK` = #{omodelRemark} | 
|       </if> | 
|       <if test="omodelRootDepartId != null"> | 
|         AND `omodel`.`ROOT_DEPART_ID` = #{omodelRootDepartId} | 
|       </if> | 
|       <if test="omodelDepartId != null"> | 
|         AND `omodel`.`DEPART_ID` = #{omodelDepartId} | 
|       </if> | 
|       <if test="omodelCustomerId != null"> | 
|         AND `omodel`.`CUSTOMER_ID` = #{omodelCustomerId} | 
|       </if> | 
|       <if test="omodelCode != null and omodelCode != ''"> | 
|         AND `omodel`.`CODE` = #{omodelCode} | 
|       </if> | 
|       <if test="omodelCustomerCate != null and omodelCustomerCate != ''"> | 
|         AND `omodel`.`CUSTOMER_CATE` = #{omodelCustomerCate} | 
|       </if> | 
|       <if test="omodelArea != null and omodelArea != ''"> | 
|         AND `omodel`.`AREA` = #{omodelArea} | 
|       </if> | 
|       <if test="omodelSaleUserId != null"> | 
|         AND `omodel`.`SALE_USER_ID` = #{omodelSaleUserId} | 
|       </if> | 
|       <if test="omodelOrigin != null"> | 
|         AND `omodel`.`ORIGIN` = #{omodelOrigin} | 
|       </if> | 
|       <if test="omodelType != null"> | 
|         AND `omodel`.`TYPE` = #{omodelType} | 
|       </if> | 
|       <if test="omodelOrderDate != null"> | 
|         AND `omodel`.`ORDER_DATE` = #{omodelOrderDate} | 
|       </if> | 
|       <if test="omodelAmount != null"> | 
|         AND `omodel`.`AMOUNT` = #{omodelAmount} | 
|       </if> | 
|       <if test="omodelUrgent != null"> | 
|         AND `omodel`.`URGENT` = #{omodelUrgent} | 
|       </if> | 
|       <if test="omodelOriginOrderId != null"> | 
|         AND `omodel`.`ORIGIN_ORDER_ID` = #{omodelOriginOrderId} | 
|       </if> | 
|       <if test="omodelStatus != null"> | 
|         AND `omodel`.`STATUS` = #{omodelStatus} | 
|       </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> |