liujie
2023-10-15 871efa21e6c95520e9825ae1f2338c9a919fdd5d
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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.stylefeng.guns.modular.system.dao.TClaimMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TClaim">
        <id column="id" property="id" />
        <result column="trucking_company_id" property="truckingCompanyId" />
        <result column="user_id" property="userId" />
        <result column="claim_type" property="claimType" />
        <result column="order_id" property="orderId" />
        <result column="describe" property="describe" />
        <result column="complaint_handling" property="complaintHandling" />
        <result column="number" property="number" />
        <result column="price" property="price" />
        <result column="create_time" property="createTime" />
        <result column="status" property="status" />
        <result column="remark" property="remark" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, trucking_company_id, user_id, claim_type, order_id, describe, complaint_handling, number, price, create_time, status, remark
    </sql>
    <delete id="deleteFile">
        delete from t_claim_file where claim_id =#{id}
    </delete>
    <select id="getList" resultType="com.stylefeng.guns.modular.system.model.TClaimList">
        select t1.id,t1.claim_type claimType,t2.company_name userName,t1.order_id orderId,t3.name companyName,t1.create_time createTime,t1.status
        from t_claim t1 left join t_user t2 on t1.user_id = t2.id left join t_company t3 on t1.trucking_company_id = t3.id
        where 1=1
        <if test="sTime !=null ">
            and t1.create_time between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and t1.status =#{state}
        </if>
        <if test="name !=null and name !=''">
            and t2.company_name like concat("%",#{name},"%")
        </if>
    </select>
    <select id="getClaimInfo" resultType="com.stylefeng.guns.modular.system.model.TClaimVo">
SELECT
    t1.id,
    t1.claim_type claimType,
    t2.name companyName,
    t1.complaint_handling complaintHandling,
    t1.trucking_company_id companyId,
    t2.headImg headImg,
    t1.describe,
    t1.remark,
    t1.number,
    t1.price,t1.order_id orderId,t1.status
FROM
    t_claim t1 LEFT JOIN t_company t2 on t1.trucking_company_id = t2.id where t1.id =#{id}
    </select>
    <select id="getOrderFile" resultType="com.stylefeng.guns.modular.system.model.TOrderFile">
        select id,order_id,file,`name`,create_time createTime from t_order_file where order_id =#{orderId}
    </select>
    <select id="getListCompany" resultType="com.stylefeng.guns.modular.system.model.TClaimList">
        select t1.id,t1.claim_type claimType,t2.company_name userName,t1.order_id orderId,t3.name companyName,t1.create_time createTime,t1.status
        from t_claim t1 left join t_user t2 on t1.user_id = t2.id left join t_company t3 on t1.trucking_company_id = t3.id
        where trucking_company_id =#{companyId}
        <if test="sTime !=null ">
            and t1.create_time between #{sTime} and #{eTime}
        </if>
        <if test="state !=null and state !=''">
            and t1.status =#{state}
        </if>
        <if test="name !=null and name !=''">
            and t2.company_name like concat("%",#{name},"%")
        </if>
    </select>
 
</mapper>