| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?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_payable_apply) -->
- <mapper namespace="com.sckw.payment.mapper.WalletPayableApplyMapper">
- <!-- This code was generated by TableGo tools, mark 1 begin. -->
- <!-- 字段映射 -->
- <resultMap id="walletPayableApplyMap" type="com.sckw.payment.entity.WalletPayableApply">
- <id column="id" property="id" />
- <result column="payable_id" property="payableId" />
- <result column="order_no" property="orderNo" />
- <result column="apply_amount" property="applyAmount" />
- <result column="paying_amount" property="payingAmount" />
- <result column="received_amount" property="receivedAmount" />
- <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">
- wpa.id, wpa.payable_id, wpa.order_no, wpa.apply_amount, wpa.paying_amount,wpa.received_amount, wpa.status, wpa.remark, wpa.del_flag,
- wpa.create_by, wpa.create_time, wpa.update_by, wpa.update_time
- </sql>
- <!-- This code was generated by TableGo tools, mark 1 end. -->
- <!-- 分页查询运费申请记录列表 -->
- <select id="selectWalletPayableApplyList" resultMap="walletPayableApplyMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_payable_apply wpa WHERE wpa.DEL_FLAG = '0'
- <if test="payableId != null">
- AND wpa.payable_id = #{payableId}
- </if>
- <if test="orderNo != null">
- AND wpa.order_no = #{orderNo}
- </if>
- </select>
- <!-- 根据主键ID查询运费申请记录 -->
- <select id="selectWalletPayableApplyById" resultMap="walletPayableApplyMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_payable_apply wpa WHERE wpa.id = #{id}
- </select>
- <select id="selectWalletPayableApplyByOrderNo" resultMap="walletPayableApplyMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_payable_apply wpa WHERE wpa.order_no = #{orderNo}
- </select>
- <!-- 根据主键ID列表查询运费申请记录列表 -->
- <select id="selectWalletPayableApplyByIds" resultMap="walletPayableApplyMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_payable_apply wpa WHERE wpa.id IN
- <foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <select id="selectPayableApplyByPayableId" resultMap="walletPayableApplyMap">
- SELECT
- <include refid="allColumns" />
- FROM wallet_payable_apply wpa
- WHERE wpa.payable_id = #{payableId}
- AND wpa.status = '0'
- AND wpa.apply_amount > (wpa.paying_amount+wpa.received_amount)
- AND wpa.DEL_FLAG = '0'
- order by wpa.create_time DESC
- </select>
- <!-- This code was generated by TableGo tools, mark 2 begin. -->
- <!-- 新增运费申请记录 -->
- <insert id="insertWalletPayableApply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- INSERT INTO wallet_payable_apply
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="payableId != null">payable_id,</if>
- <if test="orderNo != null">order_no,</if>
- <if test="applyAmount != null">apply_amount,</if>
- <if test="payingAmount != null">paying_amount,</if>
- <if test="receivedAmount != null">received_amount,</if>
- <if test="status != null">status,</if>
- <if test="remark != null">remark,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time</if>
- </trim>
- <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="payableId != null">#{payableId},</if>
- <if test="orderNo != null">#{orderNo},</if>
- <if test="applyAmount != null">#{applyAmount},</if>
- <if test="payingAmount != null">#{payingAmount},</if>
- <if test="receivedAmount != null">#{receivedAmount},</if>
- <if test="status != null">#{status},</if>
- <if test="remark != null">#{remark},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime}</if>
- </trim>
- </insert>
- <!-- 修改运费申请记录 -->
- <update id="updateWalletPayableApply">
- UPDATE wallet_payable_apply
- <set>
- <if test="payableId != null">payable_id = #{payableId},</if>
- <if test="orderNo != null">order_no = #{orderNo},</if>
- <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
- <if test="payingAmount != null">paying_amount = #{payingAmount},</if>
- <if test="receivedAmount != null">received_amount = #{receivedAmount},</if>
- <if test="status != null">status = #{status},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime}</if>
- </set>
- WHERE id = #{id}
- </update>
- <!-- This code was generated by TableGo tools, mark 2 end. -->
- <!-- 删除运费申请记录 -->
- <delete id="deleteWalletPayableApplyById">
- DELETE FROM wallet_payable_apply WHERE id = #{id}
- </delete>
- <!-- 批量删除运费申请记录 -->
- <delete id="deleteWalletPayableApplyByIds">
- DELETE FROM wallet_payable_apply WHERE id IN
- <foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <!-- 批量逻辑删除运费申请记录 -->
- <update id="deleteWalletPayableApplyLogicByIds">
- UPDATE wallet_payable_apply
- <set>
- DEL_FLAG = '2',
- UPDATE_TIME = NOW(),
- <if test="loginName != null and loginName != ''">UPDATE_BY = #{loginName}</if>
- </set>
- WHERE DEL_FLAG = '0' AND id IN
- <foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|