<?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
|
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>
|