| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--根据指定条件获取交易统计记录数--> |
| | | <select id="getTransactionStatisticsRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取交易统计记录--> |
| | | <select id="getTransactionStatistics" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics"> |
| | | SELECT * FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY tradeDate |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根基指定条件获取笔数合计、实收金额合计、赠送金额合计--> |
| | | <select id="getTransactionStatisticsSums" resultType="java.util.Map"> |
| | | SELECT |
| | | SUM(count) AS totalCount, |
| | | SUM(received) AS totalReceived, |
| | | SUM(gift) AS totalGift |
| | | FROM v_transactionstatistics |
| | | <where> |
| | | <if test = "operateTimeStart != null and operateTimeStop != null"> |
| | | AND tradeDate BETWEEN #{operateTimeStart} AND #{operateTimeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定日期、指定支付方式实收金额合计--> |
| | | <select id="getPaymentSums" resultType="java.lang.Float"> |
| | | SELECT |
| | | SUM(ope.trade_amount) AS tradeAmount |
| | | FROM se_card_operate ope |
| | | <where> |
| | | <if test = "tradeDate != null and tradeDate !=''"> |
| | | AND Date(ope.operate_dt) = #{tradeDate} |
| | | </if> |
| | | |
| | | <if test = "paymentId != null and paymentId >0"> |
| | | AND ope.payment_id = ${paymentId} |
| | | </if> |
| | | </where> |
| | | GROUP BY ope.payment_id, Date(ope.operate_dt) |
| | | </select> |
| | | |
| | | <!--根据指定条件获取开卡记录数量--> |
| | | <select id="getActiveCardRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | select |
| | |
| | | </select> |
| | | |
| | | <!--根据指定条件获取开卡记录--> |
| | | <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCardNew"> |
| | | <select id="getActiveCards" resultType="com.dy.pipIrrGlobal.voSe.VoActiveCard"> |
| | | SELECT |
| | | CAST(ope.id AS char) AS id , |
| | | cli.name AS clientName, |
| | |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取通用操作记录数量--> |
| | | <select id="getCommonOperationRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(*) AS recordCount |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN ba_user us ON ope.operator = us.id |
| | | <where> |
| | | <if test = "operateType != null and operateType > 0"> |
| | | AND ope.operate_type = ${operateType} |
| | | </if> |
| | | |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取通用操作记录--> |
| | | <select id="getCommonOperations" resultType="com.dy.pipIrrGlobal.voSe.VoOperate"> |
| | | SELECT |
| | | cli.name AS clientName, |
| | | cli.clientNum, |
| | | CAST(card.cardNum AS char) AS cardNum, |
| | | us.name AS operator, |
| | | ope.operate_dt AS operateDt, |
| | | IFNULL(ope.trade_amount,0) AS refund, |
| | | (CASE |
| | | WHEN ope.payment_id = 1 THEN "现金" |
| | | END) AS refundTypeName, |
| | | card.money, |
| | | IFNULL(ope.system_balance,0) AS systemBalance |
| | | FROM se_card_operate ope |
| | | INNER JOIN se_client cli ON ope.client_id = cli.id |
| | | INNER JOIN se_client_card card ON ope.card_id = card.id |
| | | INNER JOIN ba_user us ON ope.operator = us.id |
| | | <where> |
| | | <if test = "operateType != null and operateType > 0"> |
| | | AND ope.operate_type = ${operateType} |
| | | </if> |
| | | |
| | | <if test = "clientName != null and clientName !=''"> |
| | | AND cli.name like CONCAT('%',#{clientName},'%') |
| | | </if> |
| | | |
| | | <if test = "cardNum != null and cardNum !=''"> |
| | | AND card.cardNum like CONCAT('%',#{cardNum},'%') |
| | | </if> |
| | | |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND ope.operate_dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY ope.operate_dt DESC |
| | | <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="getReceiptsRecordCount" parameterType="java.util.Map" resultType="java.lang.Long"> |
| | | SELECT |