mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
<?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.panzhihua.service_community.dao.McsOrderDao">
 
    <resultMap type="com.panzhihua.service_community.entity.McsOrder" id="McsOrderBaseResultMap">
        <result property="id" column="id"/>
        <result property="orderNo" column="order_no"/>
        <result property="configId" column="config_id"/>
        <result property="num" column="num"/>
        <result property="status" column="status"/>
        <result property="money" column="money"/>
        <result property="payTime" column="pay_time"/>
        <result property="merchantId" column="merchant_id"/>
        <result property="payNo" column="pay_no"/>
        <result property="userId" column="user_id"/>
        <result property="paymentMethod" column="payment_method"/>
        <result property="address" column="address"/>
        <result property="lat" column="lat"/>
        <result property="lon" column="lon"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO">
        select t.*,t1.`name` as payName,t2.name as merchantName,t2.account as merchantAccount from mcs_order t
        left join mcs_config t1 on t.config_id = t1.id
        left join mcs_merchant t2 on t.merchant_id = t2.id
        <where>
            <if test="commonPage.status !=null">
                and t.status = #{commonPage.status}
            </if>
            <if test="commonPage.keyword !=null and commonPage.keyword !=''">
                and t.order_no like concat('%',#{commonPage.keyword},'%')
            </if>
            <if test="commonPage.userId !=null">
                and t.user_id = #{commonPage.userId}
            </if>
            <if test="commonPage.merchantId !=null">
                and t.merchant_id = #{commonPage.merchantId}
            </if>
        </where>
        order by t.create_time desc
    </select>
 
    <select id="detail" resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO">
        select t.*,t1.`name` as payName,t2.name as merchantName,t2.account as merchantAccount from mcs_order t
        left join mcs_config t1 on t.config_id = t1.id
        left join mcs_merchant t2 on t.merchant_id = t2.id
        where t.id =#{id}
    </select>
 
    <select id="selectPhone" resultType="string">
        select t1.phone from mcs_order t left join mcs_merchant t1 on t.merchant_id = t1.id where t.id=#{id}
    </select>
 
</mapper>