From 3948f4fc637d8439bc2a2e44c449e968b3c0fb15 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 26 一月 2024 08:58:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml |  289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 289 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
new file mode 100644
index 0000000..5dbd371
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeGeneralMapper.xml
@@ -0,0 +1,289 @@
+<?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.dy.pipIrrGlobal.daoSe.SeGeneralMapper">
+  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    <!--@mbg.generated-->
+    <!--@Table se_general-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="cashier_id" jdbcType="BIGINT" property="cashierId" />
+    <result column="cashier_name" jdbcType="VARCHAR" property="cashierName" />
+    <result column="trade_amount" jdbcType="FLOAT" property="tradeAmount" />
+    <result column="gift" jdbcType="FLOAT" property="gift" />
+    <result column="total_amount" jdbcType="FLOAT" property="totalAmount" />
+    <result column="operate_date" jdbcType="TIMESTAMP" property="operateDate" />
+    <result column="audit_status" jdbcType="TINYINT" property="auditStatus" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, cashier_id, cashier_name, trade_amount, gift, total_amount, operate_date, audit_status
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from se_general
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    <!--@mbg.generated-->
+    delete from se_general
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    <!--@mbg.generated-->
+    insert into se_general (id, cashier_id, cashier_name, 
+      trade_amount, gift, total_amount, 
+      operate_date, audit_status)
+    values (#{id,jdbcType=BIGINT}, #{cashierId,jdbcType=BIGINT}, #{cashierName,jdbcType=VARCHAR}, 
+      #{tradeAmount,jdbcType=FLOAT}, #{gift,jdbcType=FLOAT}, #{totalAmount,jdbcType=FLOAT}, 
+      #{operateDate,jdbcType=TIMESTAMP}, #{auditStatus,jdbcType=TINYINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    <!--@mbg.generated-->
+    insert into se_general
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="cashierId != null">
+        cashier_id,
+      </if>
+      <if test="cashierName != null">
+        cashier_name,
+      </if>
+      <if test="tradeAmount != null">
+        trade_amount,
+      </if>
+      <if test="gift != null">
+        gift,
+      </if>
+      <if test="totalAmount != null">
+        total_amount,
+      </if>
+      <if test="operateDate != null">
+        operate_date,
+      </if>
+      <if test="auditStatus != null">
+        audit_status,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="cashierId != null">
+        #{cashierId,jdbcType=BIGINT},
+      </if>
+      <if test="cashierName != null">
+        #{cashierName,jdbcType=VARCHAR},
+      </if>
+      <if test="tradeAmount != null">
+        #{tradeAmount,jdbcType=FLOAT},
+      </if>
+      <if test="gift != null">
+        #{gift,jdbcType=FLOAT},
+      </if>
+      <if test="totalAmount != null">
+        #{totalAmount,jdbcType=FLOAT},
+      </if>
+      <if test="operateDate != null">
+        #{operateDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="auditStatus != null">
+        #{auditStatus,jdbcType=TINYINT},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    <!--@mbg.generated-->
+    update se_general
+    <set>
+      <if test="cashierId != null">
+        cashier_id = #{cashierId,jdbcType=BIGINT},
+      </if>
+      <if test="cashierName != null">
+        cashier_name = #{cashierName,jdbcType=VARCHAR},
+      </if>
+      <if test="tradeAmount != null">
+        trade_amount = #{tradeAmount,jdbcType=FLOAT},
+      </if>
+      <if test="gift != null">
+        gift = #{gift,jdbcType=FLOAT},
+      </if>
+      <if test="totalAmount != null">
+        total_amount = #{totalAmount,jdbcType=FLOAT},
+      </if>
+      <if test="operateDate != null">
+        operate_date = #{operateDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="auditStatus != null">
+        audit_status = #{auditStatus,jdbcType=TINYINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    <!--@mbg.generated-->
+    update se_general
+    set cashier_id = #{cashierId,jdbcType=BIGINT},
+      cashier_name = #{cashierName,jdbcType=VARCHAR},
+      trade_amount = #{tradeAmount,jdbcType=FLOAT},
+      gift = #{gift,jdbcType=FLOAT},
+      total_amount = #{totalAmount,jdbcType=FLOAT},
+      operate_date = #{operateDate,jdbcType=TIMESTAMP},
+      audit_status = #{auditStatus,jdbcType=TINYINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <!--鑾峰彇鏈敓鎴愭�昏处鐨勪氦鏄撴棩鏈熷垪琛紙褰撳ぉ鐨勪氦鏄撹褰曚笉鐢熸垚鎬昏处锛�-->
+  <select id="getDatesOfNotInGenerals" resultType="java.util.HashMap">
+    SELECT
+      DISTINCT Date(ope.operate_dt) AS operateDate
+    FROM se_card_operate ope
+    WHERE Date(ope.operate_dt) NOT IN(SELECT operate_date FROM se_general) AND Date(ope.operate_dt) != CURDATE()
+  </select>
+
+  <!--鏍规嵁浜ゆ槗鏃ユ湡鑾峰彇鎬昏处璁板綍鍒楄〃锛堝緟鐢熸垚鐨勶級  -->
+  <select id="getGeneralByOperateDate" resultType="com.dy.pipIrrGlobal.pojoSe.SeGeneral">
+    SELECT
+        us.id AS cashierId,
+        us.`name` AS cashierName,
+        IFNULL(SUM(ope.trade_amount),0) AS tradeAmount,
+        IFNULL(SUM(ope.gift),0) AS gift,
+        IFNULL((SUM(ope.trade_amount) + SUM(ope.gift)),0) AS totalAmount,
+        Date(ope.operate_dt) AS operateDate,
+        1 AS auditStatus
+    FROM se_card_operate ope
+        INNER JOIN ba_user us ON ope.operator = us.id
+    WHERE Date(ope.operate_dt) = #{operateDate}
+    GROUP BY ope.operator, Date(ope.operate_dt)
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎬昏处璁板綍鏁�-->
+  <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    FROM se_general
+    <where>
+      <if test = "cashierName != null and cashierName !=''">
+        AND cashier_name like CONCAT('%',#{cashierName},'%')
+      </if>
+
+      <if test = "auditStatus != null and auditStatus > 0">
+        AND audit_status = ${auditStatus}
+      </if>
+
+      <if test = "operateDateStart != null and operateDateStop != null">
+        AND Date(operate_date) BETWEEN #{operateDateStart} AND #{operateDateStop}
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鎬昏处璁板綍-->
+  <select id="getGenerals" resultType="com.dy.pipIrrGlobal.voSe.VoGeneral">
+    SELECT
+        CAST(id AS  char) AS generalId,
+        CAST(cashier_id AS char) AS cashierId,
+        cashier_name AS cashierName,
+        trade_amount AS tradeAmount,
+        gift,
+        total_amount AS totalAmount,
+        Date(operate_date) AS operateDate,
+        (CASE
+          WHEN audit_status = 1 THEN "鏈鏍�"
+          WHEN audit_status = 2 THEN "鍚屾剰"
+          WHEN audit_status = 3 THEN "椹冲洖"
+        END) AS auditStatus
+    FROM se_general
+    <where>
+      <if test = "cashierName != null and cashierName !=''">
+        AND cashier_name like CONCAT('%',#{cashierName},'%')
+      </if>
+
+      <if test = "auditStatus != null and auditStatus > 0">
+        AND audit_status = ${auditStatus}
+      </if>
+
+      <if test = "operateDateStart != null and operateDateStop != null">
+        AND Date(operate_date) BETWEEN #{operateDateStart} AND #{operateDateStop}
+      </if>
+    </where>
+    ORDER BY Date(operate_date) DESC
+    <if test="pageCurr != null and pageSize != null">
+      LIMIT ${pageCurr}, ${pageSize}
+    </if>
+  </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>
+
+      <if test = "cashierId != null and cashierId >0">
+        AND ope.operator = ${cashierId}
+      </if>
+    </where>
+    GROUP BY ope.payment_id,  Date(ope.operate_dt)
+  </select>
+
+  <!--鏍瑰熀鎸囧畾鏃ユ湡銆佹寚瀹氭敹閾跺憳鑾峰彇绗旀暟鍚堣銆佸疄鏀堕噾棰濆悎璁°�佽禒閫侀噾棰濆悎璁�-->
+  <select id="getTransactionStatisticsSums" resultType="java.util.Map">
+    SELECT
+      SUM(count) AS totalCount,
+      SUM(received) AS totalReceived,
+      SUM(gift) AS totalGift
+    FROM v_transactionstatistics2
+    <where>
+      <if test = "tradeDate != null and tradeDate !=''">
+        AND tradeDate = #{tradeDate}
+      </if>
+
+      <if test = "cashierId != null and cashierId >0">
+        AND cashierId = ${cashierId}
+      </if>
+    </where>
+  </select>
+
+  <!--  璐㈠姟瀵硅处瀹℃牳椤碉紝鏀堕摱鍛�+鏃ユ湡鍒嗙粍锛屾帓闄や氦鏄撶被鍨嬪垎缁勶紝璁板綍鏁�-->
+  <select id="getToAuditRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    FROM v_transactionstatistics2
+    <where>
+      <if test = "cashierId != null and cashierId > 0">
+        AND cashierId = ${cashierId}
+      </if>
+
+      <if test = "tradeDate != null">
+        AND tradeDate = #{tradeDate}
+      </if>
+    </where>
+  </select>
+
+  <!--璐㈠姟瀵硅处瀹℃牳椤碉紝鏀堕摱鍛�+鏃ユ湡鍒嗙粍锛屾帓闄や氦鏄撶被鍨嬪垎缁�-->
+  <select id="getToAudit" resultType="com.dy.pipIrrGlobal.voSe.VoTransactionStatistics">
+    SELECT * FROM v_transactionstatistics2
+    <where>
+      <if test = "cashierId != null and cashierId > 0">
+        AND cashierId = ${cashierId}
+      </if>
+
+      <if test = "tradeDate != null">
+        AND tradeDate = #{tradeDate}
+      </if>
+    </where>
+    ORDER BY tradeDate
+    <if test="pageCurr != null and pageSize != null">
+      LIMIT ${pageCurr}, ${pageSize}
+    </if>
+  </select>
+</mapper>
\ No newline at end of file

--
Gitblit v1.8.0