|
|
@@ -557,6 +557,9 @@
|
|
|
LEFT join sys_office so on so.id = a.office_id
|
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
|
left join sys_area sa on sa.id = a.area_id
|
|
|
+ <if test="downloadStatus != null and downloadStatus != '' and downloadQueryUserId != null and downloadQueryUserId != ''">
|
|
|
+ LEFT JOIN work_invoice_download_record dr ON a.id = dr.invoice_id AND dr.user_id = #{downloadQueryUserId} AND dr.del_flag = '0'
|
|
|
+ </if>
|
|
|
<if test="isRedFlush != null">
|
|
|
<!-- 1:只红冲数据 -->
|
|
|
<if test="isRedFlush == 1">
|
|
|
@@ -805,15 +808,24 @@
|
|
|
<if test="newDrawer != null and newDrawer != ''">
|
|
|
and new_drawer like
|
|
|
<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
|
|
|
- <if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%' + #{newDrawer} + '%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
|
|
|
</if>
|
|
|
-
|
|
|
+
|
|
|
<if test="isOmsBilling != null">
|
|
|
AND a.is_oms_billing = #{isOmsBilling}
|
|
|
</if>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ <if test="downloadStatus != null and downloadStatus != ''">
|
|
|
+ <if test='downloadStatus == "1"'>
|
|
|
+ AND dr.invoice_id IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test='downloadStatus == "0"'>
|
|
|
+ AND dr.invoice_id IS NULL
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
${sqlMap.dsf}
|
|
|
</where>
|
|
|
<choose>
|
|
|
@@ -825,7 +837,7 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="findListOnRedInvoice" resultType="WorkInvoice" >
|
|
|
SELECT
|
|
|
a.id AS "id",
|
|
|
@@ -1313,6 +1325,9 @@
|
|
|
LEFT join sys_office so on so.id = a.office_id
|
|
|
LEFT join sys_area sa on sa.id = a.area_id
|
|
|
left join work_invoice_receipt wir on wir.invoice_id = a.id
|
|
|
+ <if test="downloadStatus != null and downloadStatus != '' and downloadQueryUserId != null and downloadQueryUserId != ''">
|
|
|
+ LEFT JOIN work_invoice_download_record dr ON a.id = dr.invoice_id AND dr.user_id = #{downloadQueryUserId} AND dr.del_flag = '0'
|
|
|
+ </if>
|
|
|
<if test="isRedFlush != null">
|
|
|
<!-- 1:只红冲数据 -->
|
|
|
<if test="isRedFlush == 1">
|
|
|
@@ -1456,6 +1471,15 @@
|
|
|
</if>
|
|
|
|
|
|
|
|
|
+ <if test="downloadStatus != null and downloadStatus != ''">
|
|
|
+ <if test='downloadStatus == "1"'>
|
|
|
+ AND dr.invoice_id IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test='downloadStatus == "0"'>
|
|
|
+ AND dr.invoice_id IS NULL
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
${sqlMap.dsf}
|
|
|
</where>
|
|
|
<choose>
|
|
|
@@ -1533,6 +1557,10 @@
|
|
|
left join sys_area sa on sa.id = a.area_id
|
|
|
</if>
|
|
|
|
|
|
+ <if test="downloadStatus != null and downloadStatus != '' and downloadQueryUserId != null and downloadQueryUserId != ''">
|
|
|
+ LEFT JOIN work_invoice_download_record dr ON a.id = dr.invoice_id AND dr.user_id = #{downloadQueryUserId} AND dr.del_flag = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
<!-- 红冲逻辑不变 -->
|
|
|
<if test="isRedFlush != null">
|
|
|
<if test="isRedFlush == 1">
|
|
|
@@ -1689,6 +1717,14 @@
|
|
|
<if test="reportNumber != null and reportNumber != ''">
|
|
|
and prds.number like concat('%',#{reportNumber},'%')
|
|
|
</if>
|
|
|
+ <if test="downloadStatus != null and downloadStatus != ''">
|
|
|
+ <if test='downloadStatus == "1"'>
|
|
|
+ AND dr.invoice_id IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test='downloadStatus == "0"'>
|
|
|
+ AND dr.invoice_id IS NULL
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
|
|
|
${sqlMap.dsf}
|
|
|
</where>
|
|
|
@@ -1740,6 +1776,11 @@
|
|
|
LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
|
|
|
</if>
|
|
|
|
|
|
+ <!-- 下载状态筛选 -->
|
|
|
+ <if test="downloadStatus != null and downloadStatus != '' and downloadQueryUserId != null and downloadQueryUserId != ''">
|
|
|
+ LEFT JOIN work_invoice_download_record dr ON a.id = dr.invoice_id AND dr.user_id = #{downloadQueryUserId} AND dr.del_flag = '0'
|
|
|
+ </if>
|
|
|
+
|
|
|
<!-- 红冲逻辑保持不变 -->
|
|
|
<if test="isRedFlush != null">
|
|
|
<if test="isRedFlush == 1">
|
|
|
@@ -1923,6 +1964,14 @@
|
|
|
<if test="isOmsBilling != null">
|
|
|
AND a.is_oms_billing = #{isOmsBilling}
|
|
|
</if>
|
|
|
+ <if test="downloadStatus != null and downloadStatus != ''">
|
|
|
+ <if test='downloadStatus == "1"'>
|
|
|
+ AND dr.invoice_id IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test='downloadStatus == "0"'>
|
|
|
+ AND dr.invoice_id IS NULL
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
${sqlMap.dsf}
|
|
|
</where>
|
|
|
|