From 5bea6e91f5c036f5267f6bd4bdff0e1cce96b040 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 20 九月 2024 15:11:13 +0800
Subject: [PATCH] 优化代码 农户管理查询
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
index 785e7b2..c5c9dd8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
@@ -198,7 +198,7 @@
</if>
<if test = "auditStatus != null and auditStatus > 0">
- AND audit_status = ${auditStatus}
+ AND audit_status = #{auditStatus}
</if>
<if test = "operateDateStart != null and operateDateStop != null">
@@ -210,17 +210,18 @@
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎬昏处璁板綍-->
<select id="getGenerals" resultType="com.dy.pipIrrGlobal.voSe.VoGeneral">
SELECT
- CAST(id AS char) AS generalId,
- CAST(cashier_id AS char) AS cashierId,
+ id AS generalId,
+ cashier_id AS cashierId,
cashier_name AS cashierName,
trade_amount AS tradeAmount,
gift,
refund_amount AS refundAmount,
+ (trade_amount + gift - refund_amount) AS totalAmount,
Date(operate_date) AS operateDate,
(CASE
- WHEN audit_status = 1 THEN "鏈鏍�"
- WHEN audit_status = 2 THEN "鍚屾剰"
- WHEN audit_status = 3 THEN "椹冲洖"
+ WHEN audit_status = 1 THEN '鏈鏍�'
+ WHEN audit_status = 2 THEN '鍚屾剰'
+ WHEN audit_status = 3 THEN '椹冲洖'
END) AS auditStatus
FROM se_general
<where>
@@ -229,7 +230,7 @@
</if>
<if test = "auditStatus != null and auditStatus > 0">
- AND audit_status = ${auditStatus}
+ AND audit_status = #{auditStatus}
</if>
<if test = "operateDateStart != null and operateDateStop != null">
@@ -255,11 +256,11 @@
</if>
<if test = "paymentId != null and paymentId >0">
- AND ope.payment_id = ${paymentId}
+ AND ope.payment_id = #{paymentId}
</if>
<if test = "cashierId != null and cashierId >0">
- AND ope.operator = ${cashierId}
+ AND ope.operator = #{cashierId}
</if>
</where>
GROUP BY ope.payment_id, Date(ope.operate_dt)
@@ -286,7 +287,7 @@
SELECT * FROM v_trade_summary
<where>
<if test = "cashierId != null and cashierId > 0">
- AND cashierId = ${cashierId}
+ AND cashierId = #{cashierId}
</if>
<if test = "timeStart != null and timeStop != null">
@@ -303,7 +304,7 @@
FROM v_trade_details
<where>
<if test = "cashierId != null and cashierId > 0">
- AND cashierId = ${cashierId}
+ AND cashierId = #{cashierId}
</if>
<if test = "tradeDate != null">
@@ -317,7 +318,7 @@
SELECT * FROM v_trade_details
<where>
<if test = "cashierId != null and cashierId > 0">
- AND cashierId = ${cashierId}
+ AND cashierId = #{cashierId}
</if>
<if test = "tradeDate != null">
--
Gitblit v1.8.0