jiangping
2023-08-17 6365ab0a976afdd247742c9b3dca15deb3a7a7a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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>