| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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">
- <!-- 预付清单(wallet_prepaid) -->
- <mapper namespace="com.sckw.payment.mapper.WalletPrepaidMapper">
- <!-- 字段映射 -->
- <resultMap id="walletPrepaidMap" type="com.sckw.payment.entity.WalletPrepaid">
- <id column="id" property="id" />
- <result column="pro_ent_id" property="proEntId" />
- <result column="sup_ent_id" property="supEntId" />
- <result column="pre_balance" property="preBalance" />
- <result column="trading_amount" property="tradingAmount" />
- <result column="status" property="status" />
- <result column="remark" property="remark" />
- <result column="del_flag" property="delFlag" />
- <result column="create_by" property="createBy" />
- <result column="create_time" property="createTime" />
- <result column="update_by" property="updateBy" />
- <result column="update_time" property="updateTime" />
- </resultMap>
- <!-- 表所有字段 -->
- <sql id="allColumns">
- wp.id, wp.pro_ent_id, wp.sup_ent_id, wp.pre_balance, wp.trading_amount, wp.status, wp.remark, wp.del_flag,
- wp.create_by, wp.create_time, wp.update_by, wp.update_time
- </sql>
- <!-- 分页查询待履约/预付清单列表 -->
- <select id="selectWalletPrepaidList" resultMap="walletPrepaidMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_prepaid wp WHERE wp.DEL_FLAG = '0'
- <choose>
- <when test="entType == 1">
- AND wp.sup_ent_id = #{curEntId}
- <if test="tradeEntId != null">
- AND wp.pro_ent_id = #{tradeEntId}
- </if>
- </when>
- <when test="entType == 2">
- AND wp.pro_ent_id = #{curEntId}
- <if test="tradeEntId != null">
- AND wp.sup_ent_id = #{tradeEntId}
- </if>
- </when>
- </choose>
- <if test="balanceMin != null">
- AND wp.pre_balance >= #{balanceMin}
- </if>
- <if test="balanceMax != null">
- AND wp.pre_balance <= #{balanceMax}
- </if>
- order by update_time Desc
- </select>
- <!-- 分页查询待履约/预付余额汇总 -->
- <select id="selectWalletPrepaidSummary" resultType="com.sckw.payment.pojo.vo.res.WalletPrepaidSummary">
- SELECT sum(wp.pre_balance) as balanceTotal, sum(wp.trading_amount) as tradingAmountTotal
- FROM wallet_prepaid wp WHERE wp.DEL_FLAG = '0'
- <choose>
- <when test="entType == 1">
- AND wp.sup_ent_id = #{curEntId}
- </when>
- <when test="entType == 2">
- AND wp.pro_ent_id = #{curEntId}
- </when>
- </choose>
- order by update_time Desc
- </select>
- <select id="selectByProEntIdAndSupEntId" resultMap="walletPrepaidMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_prepaid wp WHERE wp.pro_ent_id = #{proEntId} AND wp.sup_ent_id = #{supEntId} and wp.del_flag = 0
- </select>
- <!-- BI大屏查询所有供应商待履约金额汇总 -->
- <select id="selectAllSupplierPrepaidSummary" resultType="java.math.BigDecimal">
- SELECT COALESCE(SUM(wp.pre_balance), 0)
- FROM wallet_prepaid wp
- WHERE wp.DEL_FLAG = '0'
- </select>
- <!-- 根据主键ID列表查询预付清单列表 -->
- <select id="selectWalletPrepaidByIds" resultMap="walletPrepaidMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_prepaid wp WHERE wp.id IN
- <foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- </mapper>
|