|
|
@@ -221,11 +221,14 @@
|
|
|
io.orderno
|
|
|
from
|
|
|
ins_orders io
|
|
|
- left JOIN
|
|
|
- ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ <!--如果存在 公司查询则进行连表 -->
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
+ left JOIN
|
|
|
+ ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ </if>
|
|
|
<where>
|
|
|
<if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
- and io.orderno = #{orderNo}
|
|
|
+ and io.orderno = #{orderQueryVo.orderNo}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.deptId != null and orderQueryVo.deptId != '' and isTeamLeader">
|
|
|
and io.deptid like "${orderQueryVo.deptId}%"
|
|
|
@@ -246,7 +249,7 @@
|
|
|
and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
- and io.company_id = #{orderQueryVo.companyId}
|
|
|
+ and iac.company_id = #{orderQueryVo.companyId}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
|
|
|
and io.operatorid = #{orderQueryVo.userId}
|
|
|
@@ -255,7 +258,7 @@
|
|
|
and io.userid = #{orderQueryVo.userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- group by orderno
|
|
|
+ group by io.orderno
|
|
|
)s
|
|
|
</select>
|
|
|
|
|
|
@@ -264,11 +267,14 @@
|
|
|
io.*
|
|
|
from
|
|
|
ins_orders io
|
|
|
- left JOIN
|
|
|
- ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ <!--如果存在 公司查询则进行连表 -->
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
+ left JOIN
|
|
|
+ ins_area_company iac on iac.orderno = io.orderno
|
|
|
+ </if>
|
|
|
<where>
|
|
|
<if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
- and io.orderno = #{orderNo}
|
|
|
+ and io.orderno = #{orderQueryVo.orderNo}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.deptId != null and orderQueryVo.deptId != '' and isTeamLeader">
|
|
|
and io.deptid like "${orderQueryVo.deptId}%"
|
|
|
@@ -289,7 +295,7 @@
|
|
|
and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
- and io.company_id = #{orderQueryVo.companyId}
|
|
|
+ and iac.company_id = #{orderQueryVo.companyId}
|
|
|
</if>
|
|
|
<if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
|
|
|
and io.operatorid = #{orderQueryVo.userId}
|