|
|
@@ -742,15 +742,21 @@
|
|
|
<select id="queryPageHospitalityOrder" resultMap="BaseResultMap">
|
|
|
select
|
|
|
io.*,
|
|
|
- eic.namesimple as partnerCompaniesName
|
|
|
+ iac.orderno
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ ,eic.namesimple as partnerCompaniesName
|
|
|
+ </if>
|
|
|
from
|
|
|
ins_orders io
|
|
|
left JOIN
|
|
|
ins_area_company iac on iac.orderno = io.orderno
|
|
|
LEFT JOIN
|
|
|
ptl_agreement pa on pa.id = iac.agreement_id
|
|
|
- LEFT JOIN
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ LEFT JOIN
|
|
|
esm_ins_company eic on eic.id = pa.partner_companies_id
|
|
|
+ </if>
|
|
|
+
|
|
|
<where>
|
|
|
<if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
and io.orderno = #{orderQueryVo.orderNo}
|
|
|
@@ -759,7 +765,11 @@
|
|
|
and io.deptid like "${orderQueryVo.deptId}%"
|
|
|
</if>
|
|
|
<if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
|
|
|
+
|
|
|
and io.orderstatus = #{orderQueryVo.orderStatus}
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ and iac.orderstatus = #{orderQueryVo.orderStatus}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
|
|
|
and io.frameno = #{orderQueryVo.frameNo}
|
|
|
@@ -780,36 +790,10 @@
|
|
|
and io.userid = #{orderQueryVo.userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- group by orderno,
|
|
|
- quoteno,
|
|
|
- orderstatus,
|
|
|
- company_id,
|
|
|
- ins_company,
|
|
|
- carinfo,
|
|
|
- userid,
|
|
|
- username,
|
|
|
- deptid,
|
|
|
- deptname,
|
|
|
- ownerinfo,
|
|
|
- applyinfo,
|
|
|
- insureinfo,
|
|
|
- agreeid,
|
|
|
- productid,
|
|
|
- product,
|
|
|
- createtime,
|
|
|
- frameno,
|
|
|
- licenseno,
|
|
|
- insuredname,
|
|
|
- jqstartdate,
|
|
|
- jqenddate,
|
|
|
- systartdate,
|
|
|
- syenddate,
|
|
|
- risk,
|
|
|
- king,
|
|
|
- vehicle_and_vessel_tax,
|
|
|
- operatorid,
|
|
|
- is_external,
|
|
|
- eic.namesimple
|
|
|
+ group by io.orderno
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ ,eic.namesimple
|
|
|
+ </if>
|
|
|
order by io.createtime desc
|
|
|
</select>
|
|
|
|
|
|
@@ -819,22 +803,33 @@
|
|
|
from (
|
|
|
select
|
|
|
io.orderno
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ ,eic.namesimple as partnerCompaniesName
|
|
|
+ </if>
|
|
|
from
|
|
|
ins_orders io
|
|
|
- <!--如果存在 公司查询则进行连表 -->
|
|
|
- <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
- left JOIN
|
|
|
- ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ left JOIN
|
|
|
+ ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ LEFT JOIN
|
|
|
+ ptl_agreement pa on pa.id = iac.agreement_id
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ LEFT JOIN
|
|
|
+ esm_ins_company eic on eic.id = pa.partner_companies_id
|
|
|
</if>
|
|
|
+
|
|
|
<where>
|
|
|
<if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
and io.orderno = #{orderQueryVo.orderNo}
|
|
|
</if>
|
|
|
- <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
|
|
|
+ <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != '' ">
|
|
|
and io.deptid like "${orderQueryVo.deptId}%"
|
|
|
</if>
|
|
|
<if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
|
|
|
+
|
|
|
and io.orderstatus = #{orderQueryVo.orderStatus}
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ and iac.orderstatus = #{orderQueryVo.orderStatus}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
<if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
|
|
|
and io.frameno = #{orderQueryVo.frameNo}
|
|
|
@@ -856,6 +851,10 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
group by io.orderno
|
|
|
+ <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
|
|
|
+ ,eic.namesimple
|
|
|
+ </if>
|
|
|
+ order by io.createtime desc
|
|
|
) as s
|
|
|
</select>
|
|
|
|