Sfoglia il codice sorgente

Merge branch 'master' of http://47.108.172.52:3000/dayou/item-management-1phase

GouGengquan 11 mesi fa
parent
commit
b3a78b945f

+ 52 - 33
dao/src/main/resources/mapper/MajorProductionMapper.xml

@@ -203,41 +203,60 @@
     </select>
 
     <select id="getHouse" parameterType="com.dayou.vo.MajorProductionVO" resultType="com.dayou.vo.MajorProductionVO">
+        select
+        (@i :=  @i + 1) AS id,
+        temp.* from (SELECT
+        '大中型' AS businessType,
+        report_no AS reportNo,
+        ( CASE production WHEN 'STATEMENT' THEN '价值意见书' WHEN 'REPORT' THEN '报告' ELSE '复评函' END ) production,
+        repertory_state,
+        repertory_in_time
+        FROM
+        major_production
+        WHERE
+        deleted = 0
+        AND repertory_state = 0 UNION ALL
         SELECT
-            mp.id,
-            mp.major_id,
-            mp.report_no,
-            mp.production,
-            mp.NAME,
-            mp.client_name,
-            mp.evaluate_amount,
-            mp.repertory_state,
-            mp.repertory_in_time,
-            u.NAME AS principal
+        '资产' AS business_type,
+        production_no AS reportNo,
+        ( CASE production_type WHEN 'STATEMENT' THEN '价值意见书' WHEN 'REPORT' THEN '报告' WHEN 'CONSULT' THEN '咨询报告' WHEN 'TECHNIC' THEN '技术报告' WHEN 'FINAL' THEN '结果报告' ELSE '复评函' END ) production,
+        repertory_state,
+        repertory_in_time
         FROM
-            major_production mp
-                LEFT JOIN major m ON m.id = mp.major_id
-                LEFT JOIN user u ON u.id = m.principal_id
-            where mp.deleted = 0 and m.deleted = 0 and mp.repertory_state=0
-        <if test="keyword!=null and keyword!='' ">
-            and (
-            mp.report_no like concat ('%',#{keyword},'%')
-            or mp.NAME like concat('%',#{keyword},'%')
-            or mp.client_name like concat('%',#{keyword},'%')
-            or mp.evaluate_amount like concat('%',#{keyword},'%')
-            or u.NAME like concat('%',#{keyword},'%')
-            )
-        </if>
-        <if test="vo!=null and vo.production!=null and vo.production!=''">
-            and mp.production =#{vo.production}
-        </if>
-        <if test="vo!=null and vo.startDate!=null and vo.startDate!=''">
-            and mp.repertory_in_time &gt;= #{vo.startDate}
-        </if>
-        <if test="vo!=null and vo.endDate!=null and vo.endDate!=''">
-            and mp.repertory_in_time &lt;= #{vo.endDate}
-        </if>
-            order by mp.repertory_in_time DESC
+        assets_production
+        WHERE
+        deleted = 0
+        AND repertory_state = 0 UNION ALL
+        SELECT
+        '个贷' AS business_type,
+        p.order_id AS reportNo,
+        ( CASE pp.production WHEN 'STATEMENT' THEN '价值意见书' WHEN 'REPORT' THEN '报告' WHEN 'CONSULT' THEN '咨询报告' WHEN 'TECHNIC' THEN '技术报告' WHEN 'FINAL' THEN '结果报告' ELSE '复评函' END ) production,
+        pp.repertory_state,
+        pp.repertory_in_time
+        FROM
+        personal_production pp
+        LEFT JOIN personal_target pt ON pt.id = pp.target_id
+        LEFT JOIN personal p ON p.id = pt.personal_id
+        WHERE
+        p.deleted = 0
+        AND pp.repertory_state = 0
+        AND pt.deleted = 0
+        AND pp.deleted = 0) temp
+        <where>
+            <if test="vo!=null and vo.reportNo!=null and vo.reportNo!=''">
+                and temp.reportNo =#{vo.reportNo}
+            </if>
+            <if test="vo!=null and vo.production!=null and vo.production!=''">
+                and temp.production =#{vo.production}
+            </if>
+            <if test="vo!=null and vo.startDate!=null and vo.startDate!=''">
+                and temp.repertory_in_time &gt;= #{vo.startDate}
+            </if>
+            <if test="vo!=null and vo.endDate!=null and vo.endDate!=''">
+                and temp.repertory_in_time &lt;= #{vo.endDate}
+            </if>
+        </where>
+        order by temp.repertory_in_time desc
     </select>
 
     <sql id="myMajorOrder">

+ 2 - 0
domain/src/main/java/com/dayou/vo/MajorProductionVO.java

@@ -152,4 +152,6 @@ public class MajorProductionVO {
      */
     private Long departmentLeaderId;
 
+    private String businessType;
+
 }