Helius
2021-06-16 4e51778362c2130598a4c73ec4cebe6629dbc53f
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
<?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.xzx.gc.system.mapper.OrderComplaintMapper">
    <resultMap id="BaseResultMap" type="com.xzx.gc.entity.OrderComplaint">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="order_id" jdbcType="VARCHAR" property="orderId" />
        <result column="complaint_reason" jdbcType="VARCHAR" property="complaintReason" />
        <result column="create_time" jdbcType="VARCHAR" property="createTime" />
        <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
        <result column="after_sale_flag" jdbcType="INTEGER" property="afterSaleFlag" />
        <result column="complain_img" jdbcType="VARCHAR" property="complainImg" />
        <result column="complaint_plan" jdbcType="VARCHAR" property="complaintPlan" />
        <result column="complaint_type" jdbcType="INTEGER" property="complaintType" />
        <result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
    </resultMap>
 
    <select id="queryByOrderNoCount" resultType="int">
        select count(id) from xzx_order_complaint where order_id=#{orderId}
    </select>
 
  <select id="findPartner" resultMap="BaseResultMap">
    SELECT
      a.id,
      a.order_id,
      a.create_time ,
      c.partner_id
    FROM
      xzx_order_complaint a
      INNER JOIN xzx_order_info b ON a.order_id = b.order_id
      LEFT JOIN xzx_partner_fence c ON b.town_id = c.fence_id
  </select>
  <select id="findPartnerByTime" resultMap="BaseResultMap">
    SELECT
      a.id,
      a.order_id,
      a.create_time ,
      c.partner_id
    FROM
      xzx_order_complaint a
      INNER JOIN xzx_order_info b ON a.order_id = b.order_id
      LEFT JOIN xzx_partner_fence c ON b.town_id = c.fence_id
                                       AND c.del_flag = 0
    where
      DATE_FORMAT(a.create_time,'%Y-%m-%d')=date_sub(CURRENT_DATE(), interval 1 day)
  </select>
 
</mapper>