无关风月
2024-12-30 4ef2de7aa7fc24ee19020330e781bae0b51b956c
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
<?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.jilongda.manage.mapper.TOrderAccountingMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.jilongda.manage.model.TOrderAccounting">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="orderId" property="orderId" />
        <result column="rLens" property="rLens" />
        <result column="lLens" property="lLens" />
        <result column="frame" property="frame" />
        <result column="createTime" property="createTime" />
        <result column="updateTime" property="updateTime" />
        <result column="createBy" property="createBy" />
        <result column="updateBy" property="updateBy" />
        <result column="isDelete" property="isDelete" />
        <result column="commission" property="commission" />
        <result column="rLensProfit" property="rLensProfit" />
        <result column="lLensProfit" property="lLensProfit" />
        <result column="frameProfit" property="frameProfit" />
        <result column="payMoney" property="payMoney" />
        <result column="profitMoney" property="profitMoney" />
        <result column="profitRating" property="profitRating" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, code, orderId, rLens, lLens, frame, createTime, updateTime, createBy, updateBy, isDelete, commission, rLensProfit, lLensProfit, frameProfit, payMoney, profitMoney, profitRating
    </sql>
    <select id="pageList" resultType="com.jilongda.manage.vo.TOrderVO">
        select t1.*,t2.name as storeName from
                        t_order t1
                    left join t_store t2 on t1.storeId = t2.id
                    where 1=1
                    <if test="query.name != null and query.name != ''">
                        and t1.name like concat('%',#{query.name},'%')
                    </if>
                      <if test="query.phone != null and query.phone != ''">
                        and t1.phone like concat('%',#{query.phone},'%')
                    </if>
        <if test="req.startTime != null and req.startTime!=''">
            and (t1.createTime between #{req.startTime} and #{req.endTime})
        </if>
        <if test="req.startMoney != null ">
            and (t1.payMoney between #{req.startMoney} and #{req.endMoney})
        </if>
                    <if test="req.isAccounting != null ">
                        and t1.isAccounting = #{req.isAccounting}
                    </if>
                    <if test="req.storeId != null ">
                        and t1.storeId = #{req.storeId}
                    </if>
                            order by t1.isAccounting desc
    </select>
 
</mapper>