| | |
| | | <result column="consumeDt" jdbcType="TIMESTAMP" property="consumedt"/> |
| | | <result column="lastOper" jdbcType="TINYINT" property="lastoper"/> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks"/> |
| | | <result column="order_no" jdbcType="VARCHAR" property="orderNo" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, |
| | | protocol, |
| | | cardAddr, |
| | | cardNum, |
| | | clientId, |
| | | money, |
| | | `state`, |
| | | original_card_id, |
| | | createDt, |
| | | replaceDt, |
| | | rechargeDt, |
| | | lossDtDt, |
| | | cancelDt, |
| | | unlockDt, |
| | | reversalDt, |
| | | refundDt, |
| | | consumeDt, |
| | | lastOper, |
| | | remarks |
| | | id, protocol, cardAddr, cardNum, clientId, money, `state`, original_card_id, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, cancelDt, unlockDt, reversalDt, refundDt, consumeDt, |
| | | lastOper, remarks, order_no |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete |
| | | from se_client_card |
| | | delete from se_client_card |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!--依据水卡地址获取水卡编号(12月19日废弃)--> |
| | | <!--2024-06-30取消废弃,恢复使用--> |
| | | <select id="getCardIdByAddr" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | ORDER BY id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键(12月19日添加后废弃)--> |
| | | <select id="getCardIdByNum" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <select id="getCardIdAndClientNum" resultType="java.util.Map"> |
| | | <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> |
| | | SELECT card.id AS cardId, |
| | | cli.clientNum, |
| | | cli.id AS clientId, |
| | | protocol |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!-- 根据水卡编号获取水卡对应的农户id和姓名 --> |
| | | <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> |
| | | SELECT cli.id AS clientId, |
| | | cli.name AS clientName, |
| | | cli.address AS clientAddress |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardAddr = #{cardAddr} |
| | | and card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | |
| | | <!-- 根据水卡编号获取水卡 --> |
| | | <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> |
| | | SELECT id, |
| | | money |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | and cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据行政区划串模糊查询水卡编号--> |
| | | <select id="getCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT cardNum |
| | | FROM se_client_card |
| | | WHERE cardNum LIKE CONCAT(#{areaCode}, '%') |
| | | ORDER BY cardNum desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card (id, protocol, cardAddr, cardNum, clientId, |
| | | money, `state`, original_card_id, createDt, |
| | | insert into se_client_card (id, protocol, cardAddr, |
| | | cardNum, clientId, money, |
| | | `state`, original_card_id, createDt, |
| | | replaceDt, rechargeDt, lossDtDt, |
| | | cancelDt, unlockDt, reversalDt, refundDt, |
| | | consumeDt, lastOper, remarks) |
| | | cancelDt, unlockDt, reversalDt, |
| | | refundDt, consumeDt, lastOper, |
| | | remarks, order_no) |
| | | values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardaddr,jdbcType=VARCHAR}, |
| | | #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, |
| | | #{money,jdbcType=FLOAT}, #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, |
| | | #{createdt,jdbcType=TIMESTAMP}, |
| | | #{cardnum,jdbcType=BIGINT}, #{clientid,jdbcType=BIGINT}, #{money,jdbcType=FLOAT}, |
| | | #{state,jdbcType=TINYINT}, #{originalCardId,jdbcType=BIGINT}, #{createdt,jdbcType=TIMESTAMP}, |
| | | #{replacedt,jdbcType=TIMESTAMP}, #{rechargedt,jdbcType=TIMESTAMP}, #{lossdtdt,jdbcType=TIMESTAMP}, |
| | | #{canceldt,jdbcType=TIMESTAMP}, #{unlockdt,jdbcType=TIMESTAMP}, #{reversaldt,jdbcType=TIMESTAMP}, |
| | | #{refunddt,jdbcType=TIMESTAMP}, #{consumedt,jdbcType=TIMESTAMP}, #{lastoper,jdbcType=TINYINT}, |
| | | #{remarks,jdbcType=VARCHAR}) |
| | | #{remarks,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard" |
| | | useGeneratedKeys="true"> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_client_card |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientCard"> |
| | |
| | | `state` = #{state,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="originalCardId != null"> |
| | | `original_card_id` = #{originalCardId,jdbcType=BIGINT}, |
| | | original_card_id = #{originalCardId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="createdt != null"> |
| | | createDt = #{createdt,jdbcType=TIMESTAMP}, |
| | |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | order_no = #{orderNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | refundDt = #{refunddt,jdbcType=TIMESTAMP}, |
| | | consumeDt = #{consumedt,jdbcType=TIMESTAMP}, |
| | | lastOper = #{lastoper,jdbcType=TINYINT}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | order_no = #{orderNo,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--依据水卡地址获取水卡编号(12月19日废弃)--> |
| | | <!--2024-06-30取消废弃,恢复使用--> |
| | | <select id="getCardIdByAddr" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | ORDER BY id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键(12月19日添加后废弃)--> |
| | | <select id="getCardIdByNum" resultType="java.lang.Long"> |
| | | SELECT id AS cardId |
| | | FROM se_client_card |
| | | WHERE cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据水卡编号获取水卡表主键及农户编号--> |
| | | <select id="getCardIdAndClientNum" resultType="java.util.Map"> |
| | | <!-- SELECT id AS cardId, clientNum FROM se_client_card WHERE cardNum = #{cardNum}--> |
| | | SELECT card.id AS cardId, |
| | | cli.clientNum, |
| | | cli.id AS clientId, |
| | | protocol |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!-- 根据水卡编号获取水卡对应的农户id和姓名 --> |
| | | <select id="getClientIdAndNameByCardAddrAndCardNo" resultType="java.util.Map"> |
| | | SELECT cli.id AS clientId, |
| | | cli.name AS clientName, |
| | | cli.address AS clientAddress |
| | | FROM se_client_card card |
| | | INNER JOIN se_client cli ON card.clientId = cli.id |
| | | WHERE card.cardAddr = #{cardAddr} |
| | | and card.cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | |
| | | <!-- 根据水卡编号获取水卡 --> |
| | | <select id="getCardsByAddrAndNum" resultType="com.dy.pipIrrGlobal.voSe.VoCardInfo1"> |
| | | SELECT id, |
| | | money |
| | | FROM se_client_card |
| | | WHERE cardAddr = #{cardAddr} |
| | | and cardNum = #{cardNum} |
| | | </select> |
| | | |
| | | <!--根据行政区划串模糊查询水卡编号--> |
| | | <select id="getCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT cardNum |
| | | FROM se_client_card |
| | | WHERE cardNum LIKE CONCAT(#{areaCode}, '%') |
| | | ORDER BY cardNum desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | |
| | | <update id="updateMoney"> |
| | | update se_client_card |
| | | set money = #{money,jdbcType=FLOAT} |
| | |
| | | ); |
| | | </update> |
| | | |
| | | <!--充值机用根据订单号将水卡改为有效--> |
| | | <update id="turnCardValidByOrderNumber"> |
| | | UPDATE se_client_card |
| | | SET state = 1 |
| | | WHERE state = 4 AND order_no = #{orderNumber} |
| | | </update> |
| | | |
| | | <!--根据水卡ID获取原水卡ID,补卡通知中使用--> |
| | | <select id="getOriginalCardIdByCardId" resultType="java.lang.Long"> |
| | | SELECT original_card_id AS originalCardId FROM se_client_card WHERE id = #{cardId}; |