From 1024666b99a24bd7d5e4dc442d6b0c0319fa2f29 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期六, 17 七月 2021 22:56:48 +0800
Subject: [PATCH] 1、优化细节性问题2、优化采购细节问题

---
 java110-db/src/main/resources/mapper/fee/FeeDiscountServiceDaoImplMapper.xml |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/fee/FeeDiscountServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/FeeDiscountServiceDaoImplMapper.xml
index fd9639c..57025c7 100755
--- a/java110-db/src/main/resources/mapper/fee/FeeDiscountServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/FeeDiscountServiceDaoImplMapper.xml
@@ -4,7 +4,6 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="feeDiscountServiceDaoImpl">
 
-
     <!-- 淇濆瓨璐圭敤鎶樻墸淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveFeeDiscountInfo" parameterType="Map">
         insert into fee_discount(
@@ -14,18 +13,22 @@
         )
     </insert>
 
-
     <!-- 鏌ヨ璐圭敤鎶樻墸淇℃伅 add by wuxw 2018-07-03 -->
     <select id="getFeeDiscountInfo" parameterType="Map" resultType="Map">
         select t.discount_name,t.discount_name discountName,t.discount_desc,t.discount_desc
-        discountDesc,t.discount_type,t.discount_type discountType,t.status_cd,t.status_cd
+        discountDesc,t.discount_type,t.discount_type discountType,td.name discountTypeName,t.status_cd,t.status_cd
         statusCd,t.discount_id,t.discount_id discountId,t.community_id,t.community_id communityId,t.rule_id,t.rule_id
         ruleId,t.create_time createTime,fdr.rule_name ruleName,fdr.bean_impl beanImpl
         from fee_discount t
         left join fee_discount_rule fdr on t.rule_id = fdr.rule_id and fdr.status_cd = '0'
-        where 1 =1
+        left join t_dict td on td.status_cd = t.discount_type and td.table_name = 'fee_discount'
+        and table_columns = 'discount_type'
+        where 1 = 1
         <if test="discountName !=null and discountName != ''">
-            and t.discount_name= #{discountName}
+            and t.discount_name like '%${discountName}%'
+        </if>
+        <if test="ruleName !=null and ruleName != ''">
+            and fdr.rule_name like '%${ruleName}%'
         </if>
         <if test="discountDesc !=null and discountDesc != ''">
             and t.discount_desc= #{discountDesc}
@@ -49,9 +52,7 @@
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
-
 
     <!-- 淇敼璐圭敤鎶樻墸淇℃伅 add by wuxw 2018-07-03 -->
     <update id="updateFeeDiscountInfo" parameterType="Map">
@@ -78,16 +79,19 @@
         <if test="discountId !=null and discountId != ''">
             and t.discount_id= #{discountId}
         </if>
-
     </update>
 
     <!-- 鏌ヨ璐圭敤鎶樻墸鏁伴噺 add by wuxw 2018-07-03 -->
     <select id="queryFeeDiscountsCount" parameterType="Map" resultType="Map">
         select count(1) count
         from fee_discount t
-        where 1 =1
+        left join fee_discount_rule fdr on t.rule_id = fdr.rule_id and fdr.status_cd = '0'
+        where 1 = 1
         <if test="discountName !=null and discountName != ''">
-            and t.discount_name= #{discountName}
+            and t.discount_name like '%${discountName}%'
+        </if>
+        <if test="ruleName !=null and ruleName != ''">
+            and fdr.rule_name like '%${ruleName}%'
         </if>
         <if test="discountDesc !=null and discountDesc != ''">
             and t.discount_desc= #{discountDesc}
@@ -107,8 +111,6 @@
         <if test="ruleId !=null and ruleId != ''">
             and t.rule_id= #{ruleId}
         </if>
-
-
     </select>
 
 </mapper>

--
Gitblit v1.8.0