czt
2024-07-13 b030109e665301e7edd6ad0fe5c832ee10fe39b4
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
52
53
54
55
56
57
58
59
60
61
<?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="com.ld.igds.inout.mapper.InoutSettleServiceMapper">
 
    <!-- 基本返回信息 -->
    <sql id="BASE_COLUMN">
        S.ID_ as id,
        S.COMPANY_ID_ as companyId,
        S.TYPE_ as type,
        R.USER_NAME_ as userName,
        R.PLATE_NUM_ as plateNum,
        R.FOOD_VARIETY_ as foodVariety,
        R.COMPLETE_TIME_ as completeTime,
        R.DEPT_ID_ as deptId,
        R.DEPOT_ID_ as depotId,
        R.FOOD_LEVEL_ as foodLevel,
        S.CUSTOMER_ID_ as customerId,
        S.CUSTOMER_NAME_ as customerName,
        S.PAY_PRICE_ as payPrice,
        S.PAY_SUM_ as paySum,
        S.PAY_TYPE_ as payType,
        S.BANK_ as bank,
        S.BANK_NUM_ as bankNum,
        S.PAY_USER_ as payUser,
        S.PAY_TIME_ as payTime,
        S.FULL_WEIGHT_ as fullWeight,
        S.EMPTY_WEIGHT_ as emptyWeight,
        S.NET_WEIGHT_ as netWeight,
        S.DE_SUM_ as deSum,
        S.SETTLE_WEIGHT_ as settleWeight,
        S.OTHER_SUN_ as otherSum,
        S.REMARKS_ as remarks
    </sql>
 
    <select id="pageSettleData" resultType="com.ld.igds.models.InoutSettle"
            parameterType="com.ld.igds.inout.dto.InoutParam">
        select
        <include refid="BASE_COLUMN"/>
        from
        D_INOUT_SETTLE S
        LEFT JOIN D_INOUT_RECORD R
        ON S.ID_ = R.ID_
        <where>
            <if test="param.companyId != null and param.companyId != '' ">AND S.COMPANY_ID_ = #{param.companyId}</if>
            <if test="param.type != null and param.type != '' ">AND S.TYPE_ = #{param.type}</if>
            <if test="param.plateNum != null and param.plateNum != '' ">AND R.PLATE_NUM_ = #{param.plateNum}</if>
            <if test="param.id != null and param.id != '' ">AND S.ID_ like #{param.id}</if>
            <if test="param.end != null">AND
                S.PAY_TIME_ <![CDATA[ < ]]>#{param.end,jdbcType=TIMESTAMP}
            </if>
            <if test="param.start != null">AND
                S.PAY_TIME_ <![CDATA[ > ]]>#{param.start,jdbcType=TIMESTAMP}
            </if>
 
        </where>
    </select>
 
</mapper>