From f4d1e8f5e01e12a90050d94e50571b9cb1ebe109 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期五, 21 二月 2025 09:01:14 +0800 Subject: [PATCH] 灌溉模块4个接口 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml | 105 +++++++++++++++++++++++++++------------------------- 1 files changed, 54 insertions(+), 51 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml index c67c845..42cb6b4 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeRechargeMapper.xml @@ -35,34 +35,17 @@ where id = #{id,jdbcType=BIGINT} </delete> - <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge"> + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge"> <!--@mbg.generated--> - insert into se_recharge (id, cardId, clientId, money, amount, gift, afterRecharge, paymentId, price, remarks, `operator`, operateDt) - values (#{id,jdbcType=BIGINT}, - #{cardid,jdbcType=BIGINT}, - #{clientid,jdbcType=BIGINT}, - #{money,jdbcType=FLOAT}, - #{amount,jdbcType=FLOAT}, - #{gift,jdbcType=FLOAT}, - #{afterrecharge,jdbcType=FLOAT}, - #{paymentid,jdbcType=BIGINT}, - #{price,jdbcType=FLOAT}, - #{remarks,jdbcType=VARCHAR}, - #{operator,jdbcType=BIGINT}, - #{operatedt,jdbcType=TIMESTAMP}) + insert into se_recharge (id, cardId, clientId, money, + amount, gift, afterRecharge, + paymentId, price, remarks, + `operator`, operateDt) + values (#{id,jdbcType=BIGINT}, #{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, + #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, + #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, + #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP}) </insert> - -<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true">--> -<!-- <!–@mbg.generated–>--> -<!-- insert into se_recharge (cardId, clientId, money, --> -<!-- amount, gift, afterRecharge, --> -<!-- paymentId, price, remarks, --> -<!-- `operator`, operateDt)--> -<!-- values (#{cardid,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, --> -<!-- #{amount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{afterrecharge,jdbcType=FLOAT}, --> -<!-- #{paymentid,jdbcType=BIGINT}, #{price,jdbcType=FLOAT}, #{remarks,jdbcType=VARCHAR}, --> -<!-- #{operator,jdbcType=BIGINT}, #{operatedt,jdbcType=TIMESTAMP})--> -<!-- </insert>--> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeRecharge" useGeneratedKeys="true"> <!--@mbg.generated--> @@ -196,25 +179,34 @@ </update> <!--鏍规嵁姘村崱缂栧彿鍒犻櫎鍏呭�艰褰�--> +<!-- <delete id="deleteByCardNum" parameterType="java.lang.String">--> +<!-- DELETE FROM se_recharge WHERE cardNum = #{cardNum}--> +<!-- </delete>--> + + <!--鏍规嵁姘村崱ID鍒犻櫎鍏呭�艰褰�--> <delete id="deleteByCardId" parameterType="java.lang.Long"> - DELETE FROM se_recharge WHERE cardId = ${cardId} + DELETE FROM se_recharge WHERE cardId = #{cardId} </delete> <!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栧厖鍊艰褰�--> <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> select - COUNT(*) AS recordCount + COUNT(*) AS recordCount FROM se_recharge_history rec INNER JOIN se_client_card card ON rec.cardId = card.id - INNER JOIN ba_client cli ON rec.clientId = cli.id + INNER JOIN se_client cli ON rec.clientId = cli.id , (SELECT @i:=0) AS itable <where> <if test = "clientName != null and clientName !=''"> AND cli.name like CONCAT('%',#{clientName},'%') </if> - <if test = "cardAddr != null and cardAddr !=''"> - AND card.cardAddr like CONCAT('%',#{cardAddr},'%') + <if test = "clientNum != null and clientNum > 0"> + AND cli.clientNum like CONCAT('%',#{clientNum},'%') + </if> + + <if test = "cardNum != null and cardNum !=''"> + AND card.cardNum like CONCAT('%',#{cardNum},'%') </if> <if test = "paymentId != null and paymentId > 0"> @@ -230,31 +222,31 @@ <!--鏍规嵁鎸囧畾鐨勬潯浠惰幏鍙栧厖鍊艰褰�--> <select id="getRecharges" resultType="com.dy.pipIrrGlobal.voSe.VoRecharge"> SELECT - (@i:=@i+1) AS id, - cli.name AS clientName, - rec.clientId, - card.cardAddr, - rec.amount, - rec.afterRecharge, - rec.paymentId, - rec.price, - (SELECT `name` FROM ba_user WHERE id = rec.operator) AS operator, - rec.operateDt + (@i:=@i+1) AS id, + cli.name AS clientName, + cli.clientNum, + card.cardNum, + rec.amount, + rec.afterRecharge, + rec.paymentId, + rec.price, + (SELECT `name` FROM ba_user WHERE id = rec.operator) AS operator, + rec.operateDt FROM se_recharge_history rec - INNER JOIN se_client_card card ON rec.cardId = card.id - INNER JOIN ba_client cli ON rec.clientId = cli.id - , (SELECT @i:=0) AS itable + INNER JOIN se_client_card card ON rec.cardId = card.id + INNER JOIN se_client cli ON rec.clientId = cli.id + , (SELECT @i:=0) AS itable <where> <if test = "clientName != null and clientName !=''"> AND cli.name like CONCAT('%',#{clientName},'%') </if> - <if test = "clientId != null and clientId > 0"> - AND rec.clientId like CONCAT('%',#{clientId},'%') + <if test = "clientNum != null and clientNum > 0"> + AND cli.clientNum like CONCAT('%',#{clientNum},'%') </if> - <if test = "cardAddr != null and cardAddr !=''"> - AND card.cardAddr like CONCAT('%',#{cardAddr},'%') + <if test = "cardNum != null and cardNum !=''"> + AND card.cardNum like CONCAT('%',#{cardNum},'%') </if> <if test = "paymentId != null and paymentId > 0"> @@ -266,8 +258,19 @@ </if> </where> ORDER BY rec.operateDt DESC - <if test="pageCurr != null and pageSize != null"> - LIMIT ${pageCurr}, ${pageSize} - </if> + <trim prefix="limit " > + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> + + <select id="selectByCardId" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List" /> + from se_recharge + where cardId = #{cardId,jdbcType=BIGINT} + ORDER BY operateDt DESC + limit 0,1 </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0