<?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.TQuoteMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TQuote">
|
<id column="id" property="id" />
|
<result column="order_id" property="orderId" />
|
<result column="create_time" property="createTime" />
|
<result column="state" property="state" />
|
<result column="company_id" property="companyId" />
|
<result column="total" property="total" />
|
<result column="user_id" property="userId" />
|
<result column="create_id" property="createId" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, order_id, create_time, state
|
</sql>
|
<select id="queryDemandList" resultType="com.stylefeng.guns.modular.system.model.DemandListVo">
|
select t1.id,t2.id userId,t2.company_name companyName,
|
t3.shipment_date pickupDate,
|
t4.address origin,t3.e_address destination,
|
t1.state,t1.total weight from t_quote t1
|
left JOIN t_user t2 on t1.user_id =t2.id
|
LEFT JOIN t_order t3 on t1.order_id = t3.e_zip_z
|
LEFT JOIN t_port t4 on t3.`port` = t4.id
|
where t1.state != 3
|
<if test="sTime !=null">
|
and t1.create_time between #{sTime} and #{eTime}
|
</if>
|
<if test="state !=null and state !=''">
|
and t1.state =#{state}
|
</if>
|
<if test="userId !=null and userId !=''">
|
and t1.user_id =#{userId}
|
</if>
|
<if test="account !=null and account !=''">
|
and t2.account =#{account}
|
</if>
|
group by t1.id
|
order by t1.create_time desc
|
</select>
|
<select id="queryDemandListExport" resultType="com.stylefeng.guns.modular.system.model.DemandListVo">
|
select t1.id,t2.id userId,t2.company_name companyName,
|
t3.shipment_date pickupDate,
|
t4.address origin,t3.e_address destination,
|
t1.state,t1.total weight from t_quote t1
|
left JOIN t_user t2 on t1.user_id =t2.id
|
LEFT JOIN t_order t3 on t1.order_id = t3.e_zip_z
|
LEFT JOIN t_port t4 on t3.`port` = t4.id
|
where T1.state != 3
|
<if test="sTime !=null">
|
and t1.create_time between #{sTime} and #{eTime}
|
</if>
|
<if test="state !=null and state !=''">
|
and t1.state =#{state}
|
</if>
|
<if test="userId !=null and userId !=''">
|
and t1.user_id =#{userId}
|
</if>
|
<if test="account !=null and account !=''">
|
and t2.account =#{account}
|
</if>
|
</select>
|
|
</mapper>
|