bug
jiangping
2023-11-07 64b432916af9c9218ab3f3eca614e26c542142ae
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
50
51
<?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.BackOrderDetailMapper">
 
  <resultMap id="BaseResultMap" type="doumeemes.dao.business.model.BackOrderDetail">
    <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="ORDER_DEPART_ID" jdbcType="INTEGER" property="orderDepartId"/>
    <result column="BACKORDER_ID" jdbcType="INTEGER" property="backorderId"/>
    <result column="MATERIAL_ID" jdbcType="INTEGER" property="materialId"/>
    <result column="BATCH" jdbcType="VARCHAR" property="batch"/>
    <result column="APPLIANCE_ID" jdbcType="INTEGER" property="applianceId"/>
    <result column="PROCEDURE_ID" jdbcType="INTEGER" property="procedureId"/>
    <result column="NUM" jdbcType="DECIMAL" property="num"/>
  </resultMap>
  <sql id="Base_Column_List">
    `ID`, `DELETED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `REMARK`, `ROOT_DEPART_ID`, `ORDER_DEPART_ID`, `BACKORDER_ID`, `MATERIAL_ID`, `BATCH`, `APPLIANCE_ID`, `NUM`
  </sql>
  <select id="selectList" parameterType="doumeemes.dao.business.model.BackOrderDetail" resultMap="BaseResultMap">
    select a.*, b.code as applianceCode,d.name as materialName,d.code as materialCode
    ,f.name as procedureName,u.`NAME` as unitName,u.id as unitId
    from `back_order_detail` a
    left join appliances b on a.APPLIANCE_ID = b.ID
    left join material_distribute c on a.MATERIAL_ID = c.ID
    left join material d on c.MATERIAL_ID=d.id
    left join procedures f on f.ID=a.PROCEDURE_ID
    left join unit u on u.ID=c.UNIT_ID
    left join backorder o on o.ID=a.BACKORDER_ID
    <where>
      <if test="id != null">
        AND `a`.`ID` = #{id}
      </if>
      <if test="deleted != null">
        AND `a`.`DELETED` = #{deleted}
      </if>
      <if test="backorderId != null">
        AND `a`.`BACKORDER_ID` = #{backorderId}
      </if>
      <if test="rootDepartId != null">
        AND `a`.`ROOT_DEPART_ID` = #{rootDepartId}
      </if>
    </where>
  </select>
 
</mapper>