From 2bc6544b1e0fc955a05957b4fdda308b3a76a08f Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 09 八月 2024 16:10:18 +0800
Subject: [PATCH] 2024-08-09 朱宝民 优化代码
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml | 60 +++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
index 54511ba..895b2d3 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
@@ -21,7 +21,8 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
- <include refid="Base_Column_List" />
+<!-- <include refid="Base_Column_List" />-->
+ *
from se_virtual_card
where id = #{id,jdbcType=BIGINT}
</select>
@@ -151,6 +152,11 @@
intake_id = null
where intake_id = #{intakeId,jdbcType=BIGINT}
</update>
+ <update id="updateMoney" >
+ update se_virtual_card
+ set money = #{money,jdbcType=FLOAT}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
<!--楠岃瘉鍐滄埛鏄惁鎷ユ湁鎸囧畾鍚嶇О鐨勮櫄鎷熷崱-->
<select id="getRecordCountByName" resultType="java.lang.Integer">
SELECT COUNT(*) AS recordCount
@@ -169,13 +175,14 @@
<!--鑾峰彇鍐滄埛鍏ㄩ儴铏氭嫙鍗�-->
<select id="getVCs" resultType="com.dy.pipIrrGlobal.voSe.VoVirtualCard">
SELECT
- CAST(id AS char) AS id,
+<!-- CAST(id AS char) AS id,-->
+ id,
vc_num AS vcNum,
money,
in_use AS inUse,
(CASE
- WHEN in_use = 0 THEN "鏈娇鐢�"
- WHEN in_use = 1 THEN "浣跨敤涓�"
+ WHEN in_use = 0 THEN '鏈娇鐢�'
+ WHEN in_use = 1 THEN '浣跨敤涓�'
END) AS inUseName
FROM se_virtual_card
<where>
@@ -189,13 +196,13 @@
<!--鏍规嵁铏氭嫙鍗D鑾峰彇铏氭嫙鍗″璞�-->
<select id="getVcById" resultType="com.dy.pipIrrGlobal.voSe.VoVirtualCard">
SELECT
- CAST(id AS char) AS id,
+ id,
vc_num AS vcNum,
money,
in_use AS inUse,
(CASE
- WHEN in_use = 0 THEN "鏈娇鐢�"
- WHEN in_use = 1 THEN "浣跨敤涓�"
+ WHEN in_use = 0 THEN '鏈娇鐢�'
+ WHEN in_use = 1 THEN '浣跨敤涓�'
END) AS inUseName
FROM se_virtual_card
WHERE id = #{vcId}
@@ -211,6 +218,25 @@
<!--鏍规嵁铏氭嫙鍗$紪鍙疯幏鍙栬櫄鎷熷崱ID-->
<select id="getVcIdByNum" resultType="java.lang.Long">
SELECT id FROM se_virtual_card WHERE vc_num = #{vcNum}
+ </select>
+
+ <!--鏍规嵁铏氭嫙鍗$紪鍙疯幏鍙栬櫄鎷熷崱ID-->
+ <select id="getClientIdAndNameByVsCardNo" resultType="java.util.Map">
+ SELECT
+ cli.id AS clientId,
+ cli.name AS clientName
+ FROM se_virtual_card card
+ INNER JOIN se_client cli ON card.client_id = cli.id
+ WHERE card.vc_num = #{vcNum}
+ </select>
+
+ <!-- 鏍规嵁姘村崱缂栧彿鑾峰彇铏氭嫙姘村崱 -->
+ <select id="getCardsByNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1">
+ SELECT
+ id,
+ money
+ FROM se_virtual_card
+ WHERE vc_num = #{cardNum}
</select>
<!--鏍规嵁琛屾斂鍖哄垝涓叉ā绯婃煡璇㈣櫄鎷熷崱缂栧彿-->
@@ -236,18 +262,14 @@
recharge_time AS rechargeTime,
order_state AS orderState,
(CASE
- WHEN order_state = 1 THEN "鏈敮浠�"
- WHEN order_state = 2 THEN "宸叉敮浠�"
+ WHEN order_state = 1 THEN '鏈敮浠�'
+ WHEN order_state = 2 THEN '宸叉敮浠�'
END) AS orderStateName
FROM se_vc_recharge
- <where>
- <if test = "orderState != null">
- order_state = #{orderState,jdbcType=TINYINT}
- </if>
- </where>
+ where order_state = 2
order by recharge_time DESC
- <if test="pageCurr != null and pageSize != null">
- LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
+ <if test="start != null and count != null">
+ LIMIT #{start}, #{count}
</if>
</select>
@@ -255,10 +277,6 @@
SELECT
COUNT(*)
FROM se_vc_recharge
- <where>
- <if test = "orderState != null">
- order_state = #{orderState,jdbcType=TINYINT}
- </if>
- </where>
+ where order_state = 2
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0