Sfoglia il codice sorgente

审计金额 报备类型 sql条件更改

lijt 1 anno fa
parent
commit
5e7c326fe9

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/domain/AuditFindDto.java

@@ -20,11 +20,13 @@ public class AuditFindDto implements Serializable {
     /**
      * id
      */
-    private String ReportId;
+    private String reportId;
     /**
      * 项目名称
      */
     private String projectName;
+
+    private String programName;
     /**
      *报告号
      */

+ 3 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/mapper/CwWorkClientBaseMapper.java

@@ -28,8 +28,6 @@ public interface CwWorkClientBaseMapper extends BaseMapper<CwWorkClientBase> {
      * @return
      */
     IPage<AuditFindDto> auditFindListBy(Page<AuditFindDto> page,@Param(Constants.WRAPPER) QueryWrapper<AuditFindDto> queryWrapper);
-
-
     /**
      * 审计收费查询
      * @param
@@ -69,7 +67,9 @@ public interface CwWorkClientBaseMapper extends BaseMapper<CwWorkClientBase> {
 
     // 根据客户的id数组查询客户的no(编号)集合
     List<String> getNoByIdArray(String[] idArray);
-  }
+
+
+}
 
 
 

+ 52 - 30
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml

@@ -394,41 +394,63 @@
     </select>
     <select id="auditFindList" resultType="com.jeeplus.test.cw.workClientInfo.domain.AuditFindDto">
 
-        SELECT
-            base.program_id,
-            records.project_name ,
-            line.report_no ,
-            invoice.NO ,
-            detail.number ,
-            base1.account ,
-            invoice.billing_people ,
-            invoice.billing_date
-        FROM
-            cw_project_report_archive AS arc
-                LEFT JOIN cw_finance_invoice_base AS base ON base.program_id = arc.project_id and base.del_flag = '0'
-                LEFT JOIN cw_finance_invoice_base AS base1 ON base1.invoice_id = base.invoice_id and base1.del_flag = '0'
-                LEFT JOIN cw_project_records AS records ON records.id = base1.program_id and records.del_flag = '0'
-                LEFT JOIN cw_finance_invoice AS invoice ON invoice.id = base1.invoice_id and invoice.del_flag = '0'
-                LEFT JOIN cw_finance_invoice_detail AS detail ON detail.invoice_id = base1.invoice_id and detail.del_flag = '0'
-                LEFT JOIN cw_project_report AS report ON report.id = arc.report_id and report.del_flag = '0'
-                LEFT JOIN cw_project_report_new_line AS line ON line.report_id=report.id and line.del_flag = '0'
-            ${ew.customSqlSegment}
+select
+    t.*
+       from
+            (
+           SELECT
+               base1.program_name ,
+               line.report_no ,
+               invoice.NO ,
+               detail.number ,
+               base1.account ,
+               invoice.billing_people ,
+               invoice.billing_date
+           FROM
+               cw_project_report_archive AS arc
+                   LEFT JOIN cw_finance_invoice_base AS base ON base.program_id = arc.report_id
+                   LEFT JOIN cw_finance_invoice_base AS base1 ON base1.invoice_id = base.invoice_id
+                   LEFT JOIN cw_project_report_new_line AS line ON line.report_id = base1.program_id
+                   LEFT JOIN cw_finance_invoice AS invoice ON invoice.id = base1.invoice_id
+                   LEFT JOIN cw_finance_invoice_detail AS detail ON detail.invoice_id = invoice.id
+           ${ew.customSqlSegment}
+UNION ALL
+SELECT
+    base1.program_name,
+    line.report_no ,
+    invoice.NO ,
+    detail.number,
+    base1.account,
+    invoice.billing_people,
+    invoice.billing_date
+FROM
+    cw_project_report_archive AS arc
+        LEFT JOIN cw_finance_invoice_base AS base ON base.program_id = arc.project_id
+        LEFT JOIN cw_finance_invoice_base AS base1 ON base1.invoice_id = base.invoice_id
+        LEFT JOIN cw_project_report_new_line AS line ON line.report_id = base1.program_id
+        LEFT JOIN cw_finance_invoice AS invoice ON invoice.id = base1.invoice_id
+        LEFT JOIN cw_finance_invoice_detail AS detail ON detail.invoice_id = invoice.id
+    ${ew.customSqlSegment}
+
+           ) as  t
+
     </select>
 
     <select id="auditFindListBy" resultType="com.jeeplus.test.cw.workClientInfo.domain.AuditFindDto">
         SELECT
-        records.project_name,
-        line.report_no,
-        report.audit_fees,
-        USER.NAME,
-        line.create_date
+            records.project_name,
+            line.report_no,
+            record.audit_fees,
+            USER.NAME,
+            line.create_date
         FROM
-        cw_project_report_archive AS arc
-        LEFT JOIN cw_project_records AS records ON records.id = arc.project_id and records.del_flag = '0'
-        LEFT JOIN cw_project_report AS report ON report.id = arc.report_id and report.del_flag = '0'
-        LEFT JOIN cw_project_report_new_line AS line ON line.report_id = report.id and line.del_flag = '0'
-        LEFT JOIN sys_user AS USER ON USER.id = line.create_by and USER.del_flag = '0'
-            ${ew.customSqlSegment}
+            cw_project_report_archive AS arc
+                LEFT JOIN cw_project_report AS record ON record.project_id = arc.project_id
+                LEFT JOIN cw_project_records AS records ON records.id = record.project_id
+                LEFT JOIN cw_project_report_new_line AS line ON line.report_id = record.id
+                LEFT JOIN sys_user AS USER ON USER.id = record.create_by
+        ${ew.customSqlSegment}
     </select>
 
+
 </mapper>

+ 4 - 6
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/service/CwWorkClientService.java

@@ -80,8 +80,7 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
      */
     public IPage<AuditFindDto> auditFindListBy(AuditFindDto auditFindDto, Page<AuditFindDto> page) throws Exception {
         QueryWrapper<AuditFindDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (auditFindDto, AuditFindDto.class);
-        queryWrapper.eq("arc.id", auditFindDto.getReportId()).ne("report.audit_fees",null).ne("report.audit_fees",0);
-
+        queryWrapper.eq("arc.id", auditFindDto.getReportId());
         IPage<AuditFindDto> list = cwWorkClientBaseMapper.auditFindListBy(page, queryWrapper);
         return list;
     }
@@ -91,9 +90,8 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
      */
     public IPage<AuditFindDto> auditFindList(AuditFindDto auditFindDto, Page<AuditFindDto> page) throws Exception {
          QueryWrapper<AuditFindDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (auditFindDto, AuditFindDto.class);
-
         queryWrapper.eq("arc.id", auditFindDto.getReportId());
-        queryWrapper.eq("arc.status", 5);
+        queryWrapper.eq("invoice.status", 5);
 
         if (ObjectUtil.isNotEmpty(auditFindDto)) {
             if (StringUtils.isNotBlank(auditFindDto.getNumber())){
@@ -105,12 +103,12 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
             }
             if (StringUtils.isNotBlank(auditFindDto.getReportNo())){
                 queryWrapper.like("report.project_report_number", auditFindDto.getReportNo());
+
             }
         }
 
          IPage<AuditFindDto> list = cwWorkClientBaseMapper.auditFindList(page, queryWrapper);
-         return list;
-
+        return list;
     }