| <?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.business.SalesorderMapper"> | 
|   | 
|   <resultMap id="BaseResultMap" type="doumeemes.dao.business.model.Salesorder"> | 
|     <id column="ID" jdbcType="INTEGER" property="id"/> | 
|     <result column="DELETED" jdbcType="TINYINT" property="deleted"/> | 
|     <result column="CREATE_USER" jdbcType="INTEGER" property="createUser"/> | 
|     <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/> | 
|     <result column="UPDATE_USER" jdbcType="INTEGER" property="updateUser"/> | 
|     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/> | 
|     <result column="REMARK" jdbcType="VARCHAR" property="remark"/> | 
|     <result column="ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/> | 
|     <result column="DEPART_ID" jdbcType="INTEGER" property="departId"/> | 
|     <result column="CUSTOMER_ID" jdbcType="INTEGER" property="customerId"/> | 
|     <result column="CODE" jdbcType="VARCHAR" property="code"/> | 
|     <result column="CUSTOMER_CATE" jdbcType="VARCHAR" property="customerCate"/> | 
|     <result column="AREA" jdbcType="VARCHAR" property="area"/> | 
|     <result column="SALE_USER_ID" jdbcType="INTEGER" property="saleUserId"/> | 
|     <result column="ORIGIN" jdbcType="TINYINT" property="origin"/> | 
|     <result column="TYPE" jdbcType="TINYINT" property="type"/> | 
|     <result column="ORDER_DATE" jdbcType="TIMESTAMP" property="orderDate"/> | 
|     <result column="AMOUNT" jdbcType="INTEGER" property="amount"/> | 
|     <result column="URGENT" jdbcType="TINYINT" property="urgent"/> | 
|     <result column="ORIGIN_ORDER_ID" jdbcType="INTEGER" property="originOrderId"/> | 
|     <result column="STATUS" jdbcType="TINYINT" property="status"/> | 
|   </resultMap> | 
|   | 
|   <select id="selectList" parameterType="doumeemes.dao.business.model.Salesorder" resultType="doumeemes.dao.business.model.Salesorder"> | 
|     select a.*,b.NAME as customerName | 
|     from `salesorder` a | 
|     left join customer b on a.CUSTOMER_ID =b.id | 
|     <where> | 
|     <if test="id != null"> | 
|       AND `a`.`ID` = #{id} | 
|     </if> | 
|     <if test="deleted != null"> | 
|       AND `a`.`DELETED` = #{id} | 
|     </if> | 
|     <if test="rootDepartId != null"> | 
|       AND `a`.`ROOT_DEPART_ID` = #{rootDepartId} | 
|     </if> | 
|     <if test="departId != null"> | 
|       AND `a`.`DEPART_ID` = #{departId} | 
|     </if> | 
|     </where> | 
|   </select> | 
|   | 
| </mapper> |