|  |  |  | 
|---|
|  |  |  | 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--> | 
|---|
|  |  |  | 
|---|
|  |  |  | </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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <!--根据指定的条件获取充值记录--> | 
|---|
|  |  |  | <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 = "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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | AND rec.operateDt BETWEEN #{rechargeTimeStart} AND #{rechargeTimeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="pageCurr != null and pageSize != null"> | 
|---|
|  |  |  | LIMIT ${pageCurr}, ${pageSize} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | ORDER BY rec.operateDt DESC | 
|---|
|  |  |  | <trim prefix="limit " > | 
|---|
|  |  |  | <if test="start != null and count != null"> | 
|---|
|  |  |  | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|