|
@@ -370,6 +370,73 @@
|
|
|
) as s
|
|
) as s
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryPageDeleteOrderCount" resultType="Long">
|
|
|
|
|
+ select
|
|
|
|
|
+ count(1)
|
|
|
|
|
+ from (
|
|
|
|
|
+ select
|
|
|
|
|
+ io.orderno
|
|
|
|
|
+ from
|
|
|
|
|
+ ins_orders io
|
|
|
|
|
+ <!--如果存在 公司查询则进行连表 -->
|
|
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
|
|
+ left JOIN
|
|
|
|
|
+ ins_area_company iac on iac.orderno = io.orderno
|
|
|
|
|
+ </if>
|
|
|
|
|
+ where
|
|
|
|
|
+ io.del_flag = 1)
|
|
|
|
|
+ <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
|
|
+ and io.orderno = #{orderQueryVo.orderNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <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>
|
|
|
|
|
+ <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
|
|
|
|
|
+ and io.frameno = #{orderQueryVo.frameNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
|
|
|
|
|
+ and io.licenseno = #{orderQueryVo.licenseNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
|
|
|
|
|
+ and io.insuredname = #{orderQueryVo.insuredName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
|
|
|
|
|
+ and DATE_FORMAT(io.createtime, '%Y-%m-%d') between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
|
|
+ and iac.company_id = #{orderQueryVo.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!--
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
|
|
|
|
|
+ and io.operatorid = #{orderQueryVo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ -->
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="isCdy">
|
|
|
|
|
+ <if test="deptId != null and deptId != '' ">
|
|
|
|
|
+ and io.deptid like "${deptId}%"
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="isDxFlag">
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' ">
|
|
|
|
|
+ and io.userid in ( select id from sys_user where manager_id = #{orderQueryVo.userId} or id =
|
|
|
|
|
+ #{orderQueryVo.userId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
|
|
|
|
|
+ and io.userid = #{orderQueryVo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ group by io.orderno
|
|
|
|
|
+ ) as s
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="queryPageOrder" resultMap="BaseResultMap">
|
|
<select id="queryPageOrder" resultMap="BaseResultMap">
|
|
|
select
|
|
select
|
|
|
io.*
|
|
io.*
|
|
@@ -444,6 +511,78 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ <select id="queryPageDeleteOrder" resultMap="BaseResultMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ io.*
|
|
|
|
|
+ from
|
|
|
|
|
+ ins_orders io
|
|
|
|
|
+ <!--如果存在 公司查询则进行连表 -->
|
|
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
|
|
+ left JOIN
|
|
|
|
|
+ ins_area_company iac on iac.orderno = io.orderno
|
|
|
|
|
+ </if>
|
|
|
|
|
+ where
|
|
|
|
|
+ io.del_flag = 1
|
|
|
|
|
+ <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
|
|
|
|
|
+ and io.orderno = #{orderQueryVo.orderNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <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>
|
|
|
|
|
+ <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
|
|
|
|
|
+ and io.frameno = #{orderQueryVo.frameNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
|
|
|
|
|
+ and io.licenseno = #{orderQueryVo.licenseNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
|
|
|
|
|
+ and io.insuredname = #{orderQueryVo.insuredName}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
|
|
|
|
|
+ and DATE_FORMAT(io.createtime, '%Y-%m-%d') between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
|
|
|
|
|
+ and iac.company_id = #{orderQueryVo.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.product != null and orderQueryVo.product != ''">
|
|
|
|
|
+ and io.product = #{orderQueryVo.product}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderQueryVo.productid != null and orderQueryVo.productid != ''">
|
|
|
|
|
+ and io.productid = #{orderQueryVo.productid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ <!--
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
|
|
|
|
|
+ and io.operatorid = #{orderQueryVo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ -->
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="isCdy">
|
|
|
|
|
+ <if test="deptId != null and deptId != '' ">
|
|
|
|
|
+ and io.deptid like "${deptId}%"
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="isDxFlag">
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' ">
|
|
|
|
|
+ and io.userid in ( select id from sys_user where manager_id = #{orderQueryVo.userId} or id =
|
|
|
|
|
+ #{orderQueryVo.userId} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <otherwise>
|
|
|
|
|
+ <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
|
|
|
|
|
+ and io.userid = #{orderQueryVo.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </otherwise>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ group by
|
|
|
|
|
+ orderno, io.createtime
|
|
|
|
|
+ order by io.createtime desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<select id="queryOrderList" parameterType="com.ydtech.modules.ins.model.InsOrdersExcelVo" resultMap="OrderExcelResultMap">
|
|
<select id="queryOrderList" parameterType="com.ydtech.modules.ins.model.InsOrdersExcelVo" resultMap="OrderExcelResultMap">
|
|
|
select
|
|
select
|
|
|
a.orderno,
|
|
a.orderno,
|
|
@@ -2086,4 +2225,8 @@
|
|
|
order by io.createtime desc
|
|
order by io.createtime desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <update id="updateDelFlag">
|
|
|
|
|
+ update ins_orders set del_flag = NULL where orderno = #{orderNo}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|