123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yijia.customer.mapper.CustomerCardRecordRechargeMapper">
-
- <resultMap type="CustomerCardRecordRecharge" id="CustomerCardRecordRechargeResult">
- <result property="id" column="id" />
- <result property="orderNo" column="order_no" />
- <result property="unionId" column="union_id" />
- <result property="customerNo" column="customer_no" />
- <result property="customerName" column="customer_name" />
- <result property="usageType" column="usage_type" />
- <result property="payType" column="pay_type" />
- <result property="cardOilsType" column="card_oils_type" />
- <result property="amt" column="amt" />
- <result property="presentAmt" column="present_amt" />
- <result property="balance" column="balance" />
- <result property="createTime" column="create_time" />
- <result property="stationId" column="station_id" />
- <result property="stationName" column="station_name" />
- <result property="status" column="status" />
- </resultMap>
- <sql id="selectCustomerCardRecordRechargeVo">
- select id, order_no, union_id, customer_no, customer_name, usage_type, pay_type, card_oils_type, amt, present_amt, balance, create_time, station_id, station_name, status from customer_card_record_recharge
- </sql>
- <select id="selectCustomerCardRecordRechargeList" parameterType="CustomerCardRecordRecharge" resultMap="CustomerCardRecordRechargeResult">
- <include refid="selectCustomerCardRecordRechargeVo"/>
- <where>
- <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="usageType != null and usageType != ''"> and usage_type = #{usageType}</if>
- <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
- <if test="cardOilsType != null and cardOilsType != ''"> and card_oils_type = #{cardOilsType}</if>
- <if test="amt != null "> and amt = #{amt}</if>
- <if test="presentAmt != null "> and present_amt = #{presentAmt}</if>
- <if test="balance != null "> and balance = #{balance}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- </where>
- order by id desc
- </select>
-
- <select id="selectCustomerCardRecordRechargeById" parameterType="Long" resultMap="CustomerCardRecordRechargeResult">
- <include refid="selectCustomerCardRecordRechargeVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCustomerCardRecordRecharge" parameterType="CustomerCardRecordRecharge" useGeneratedKeys="true" keyProperty="id">
- insert into customer_card_record_recharge
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">order_no,</if>
- <if test="unionId != null">union_id,</if>
- <if test="customerNo != null">customer_no,</if>
- <if test="customerName != null">customer_name,</if>
- <if test="usageType != null">usage_type,</if>
- <if test="payType != null">pay_type,</if>
- <if test="cardOilsType != null">card_oils_type,</if>
- <if test="amt != null">amt,</if>
- <if test="presentAmt != null">present_amt,</if>
- <if test="balance != null">balance,</if>
- <if test="createTime != null">create_time,</if>
- <if test="stationId != null">station_id,</if>
- <if test="stationName != null">station_name,</if>
- <if test="status != null">status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderNo != null">#{orderNo},</if>
- <if test="unionId != null">#{unionId},</if>
- <if test="customerNo != null">#{customerNo},</if>
- <if test="customerName != null">#{customerName},</if>
- <if test="usageType != null">#{usageType},</if>
- <if test="payType != null">#{payType},</if>
- <if test="cardOilsType != null">#{cardOilsType},</if>
- <if test="amt != null">#{amt},</if>
- <if test="presentAmt != null">#{presentAmt},</if>
- <if test="balance != null">#{balance},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="stationId != null">#{stationId},</if>
- <if test="stationName != null">#{stationName},</if>
- <if test="status != null">#{status},</if>
- </trim>
- </insert>
- <update id="updateCustomerCardRecordRecharge" parameterType="CustomerCardRecordRecharge">
- update customer_card_record_recharge
- <trim prefix="SET" suffixOverrides=",">
- <if test="orderNo != null">order_no = #{orderNo},</if>
- <if test="unionId != null">union_id = #{unionId},</if>
- <if test="customerNo != null">customer_no = #{customerNo},</if>
- <if test="customerName != null">customer_name = #{customerName},</if>
- <if test="usageType != null">usage_type = #{usageType},</if>
- <if test="payType != null">pay_type = #{payType},</if>
- <if test="cardOilsType != null">card_oils_type = #{cardOilsType},</if>
- <if test="amt != null">amt = #{amt},</if>
- <if test="presentAmt != null">present_amt = #{presentAmt},</if>
- <if test="balance != null">balance = #{balance},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="stationName != null">station_name = #{stationName},</if>
- <if test="status != null">status = #{status},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCustomerCardRecordRechargeById" parameterType="Long">
- delete from customer_card_record_recharge where id = #{id}
- </delete>
- <delete id="deleteCustomerCardRecordRechargeByIds" parameterType="String">
- delete from customer_card_record_recharge where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="czAmtQuery" parameterType="CustomerCardRecordRecharge" resultMap="CustomerCardRecordRechargeResult">
- SELECT sum(amt) as amt from customer_card_record_recharge
- <where>
- <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="usageType != null and usageType != ''"> and usage_type = #{usageType}</if>
- <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
- <if test="cardOilsType != null and cardOilsType != ''"> and card_oils_type = #{cardOilsType}</if>
- <if test="amt != null "> and amt = #{amt}</if>
- <if test="presentAmt != null "> and present_amt = #{presentAmt}</if>
- <if test="balance != null "> and balance = #{balance}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- </where>
- </select>
- <select id="listQydataCZ" parameterType="CustomerCardRecordRecharge" resultMap="CustomerCardRecordRechargeResult">
- SELECT date_format(create_time,'%Y-%m-%d') as create_time,sum(amt) as amt
- from customer_card_record_recharge
- <where>
- <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="usageType != null and usageType != ''"> and usage_type = #{usageType}</if>
- <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
- <if test="cardOilsType != null and cardOilsType != ''"> and card_oils_type = #{cardOilsType}</if>
- <if test="amt != null "> and amt = #{amt}</if>
- <if test="presentAmt != null "> and present_amt = #{presentAmt}</if>
- <if test="balance != null "> and balance = #{balance}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- </where>
- GROUP BY date_format(create_time,'%Y-%m-%d')
- </select>
- <select id="listCZData" parameterType="CustomerCardRecordRecharge" resultMap="CustomerCardRecordRechargeResult">
- SELECT sum(amt) as amt
- from customer_card_record_recharge
- <where>
- <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="usageType != null and usageType != ''"> and usage_type = #{usageType}</if>
- <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
- <if test="cardOilsType != null and cardOilsType != ''"> and card_oils_type = #{cardOilsType}</if>
- <if test="amt != null "> and amt = #{amt}</if>
- <if test="presentAmt != null "> and present_amt = #{presentAmt}</if>
- <if test="balance != null "> and balance = #{balance}</if>
- <if test="stationId != null "> and station_id = #{stationId}</if>
- <if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="stationIdList != null ">
- and station_id in
- <foreach item="item" index="index" collection="stationIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
- AND date_format(create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- </where>
- </select>
- <!--存储过程-->
- <select id="selectCardDetail" parameterType="CustomerCardRecordRecharge" statementType="CALLABLE" resultMap="CustomerCardRecordRechargeResult">
- CALL selectCardDetail(#{strSql,mode=IN},#{createDate,mode=IN},#{pageSetting,mode=IN},#{pageNo,mode=IN})
- </select>
- <select id="selectCardDetailPage" parameterType="CustomerCardRecordRecharge" statementType="CALLABLE" resultMap="CustomerCardRecordRechargeResult">
- CALL selectCardDetailPage(#{strSql,mode=IN},#{createDate,mode=IN})
- </select>
- </mapper>
|