| <?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.UnitConversionExtMapper"> | 
|   | 
|   <!-- 管理页面查询 --> | 
|   <resultMap id="UnitConversionExtListVO" type="doumeemes.dao.ext.vo.UnitConversionExtListVO" autoMapping="true"> | 
|     <id column="ID" jdbcType="INTEGER" property="id"/> | 
|     <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="cmodel" javaType="doumeemes.dao.business.model.Unit"> | 
|       <id column="CMODEL_ID" jdbcType="INTEGER" property="id"/> | 
|       <result column="CMODEL_DELETED" jdbcType="TINYINT" property="deleted"/> | 
|       <result column="CMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|       <result column="CMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|       <result column="CMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|       <result column="CMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|       <result column="CMODEL_REMARK" jdbcType="VARCHAR" property="remark"/> | 
|       <result column="CMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|       <result column="CMODEL_NAME" jdbcType="VARCHAR" property="name"/> | 
|       <result column="CMODEL_TYPE" jdbcType="TINYINT" property="type"/> | 
|       <result column="CMODEL_STATUS" jdbcType="TINYINT" property="status"/> | 
|     </association> | 
|   </resultMap> | 
|   <select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryUnitConversionExtDTO" resultMap="UnitConversionExtListVO"> | 
|     SELECT | 
|       `a`.`ID`, | 
|       `a`.`DELETED`, | 
|       `a`.`CREATE_USER`, | 
|       `a`.`CREATE_TIME`, | 
|       `a`.`UPDATE_USER`, | 
|       `a`.`UPDATE_TIME`, | 
|       `a`.`REMARK`, | 
|       `a`.`ROOT_DEPART_ID`, | 
|       `a`.`MATERIAL_ID`, | 
|       `a`.`ORIGIN`, | 
|       `a`.`CONVERTED_TYPE`, | 
|       `a`.`CONVERTED_ID`, | 
|       `a`.`CONVERTED_NUM`, | 
|       `a`.`CONVERTED_RATIO`, | 
|       `a`.`UNIT_TYPE`, | 
|       `a`.`UNIT_ID`, | 
|       `a`.`UNIT_NUM`, | 
|       `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, | 
|     `cmodel`.`ID` AS CMODEL_ID, | 
|     `cmodel`.`DELETED` AS CMODEL_DELETED, | 
|     `cmodel`.`CREATE_USER` AS CMODEL_CREATE_USER, | 
|     `cmodel`.`CREATE_TIME` AS CMODEL_CREATE_TIME, | 
|     `cmodel`.`UPDATE_USER` AS CMODEL_UPDATE_USER, | 
|     `cmodel`.`UPDATE_TIME` AS CMODEL_UPDATE_TIME, | 
|     `cmodel`.`REMARK` AS CMODEL_REMARK, | 
|     `cmodel`.`ROOT_DEPART_ID` AS CMODEL_ROOT_DEPART_ID, | 
|     `cmodel`.`NAME` AS CMODEL_NAME, | 
|     `cmodel`.`TYPE` AS CMODEL_TYPE, | 
|     `cmodel`.`STATUS` AS CMODEL_STATUS | 
|     FROM `unit_conversion` `a` | 
|     LEFT JOIN `material` `mmodel` ON a.MATERIAL_ID=mmodel.ID | 
|     LEFT JOIN `unit` `umodel` ON a.UNIT_ID=umodel.ID | 
|     LEFT JOIN `unit` `cmodel` ON cmodel.id=a.CONVERTED_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="materialId != null and materialId != ''"> | 
|         AND `a`.`MATERIAL_ID` = #{materialId} | 
|       </if> | 
|       <if test="origin != null"> | 
|         AND `a`.`ORIGIN` = #{origin} | 
|       </if> | 
|       <if test="convertedType != null"> | 
|         AND `a`.`CONVERTED_TYPE` = #{convertedType} | 
|       </if> | 
|       <if test="convertedId != null"> | 
|         AND `a`.`CONVERTED_ID` = #{convertedId} | 
|       </if> | 
|       <if test="convertedNum != null"> | 
|         AND `a`.`CONVERTED_NUM` = #{convertedNum} | 
|       </if> | 
|       <if test="convertedRatio != null"> | 
|         AND `a`.`CONVERTED_RATIO` = #{convertedRatio} | 
|       </if> | 
|       <if test="unitType != null"> | 
|         AND `a`.`UNIT_TYPE` = #{unitType} | 
|       </if> | 
|       <if test="unitId != null"> | 
|         AND `a`.`UNIT_ID` = #{unitId} | 
|       </if> | 
|       <if test="unitNum != null"> | 
|         AND `a`.`UNIT_NUM` = #{unitNum} | 
|       </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> | 
|     </where> | 
|     order  by `a`.`ID` desc | 
|   </select> | 
| </mapper> |