|
@@ -1,112 +1,147 @@
|
|
|
<?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.ym.mec.biz.dal.dao.SysAccountDao">
|
|
|
- <resultMap id="SysAccount" type="com.ym.mec.biz.dal.entity.SysAccount">
|
|
|
- <!--@Table sys_account-->
|
|
|
- <id column="id_" jdbcType="INTEGER" property="id" />
|
|
|
- <result column="company_" jdbcType="VARCHAR" property="company" />
|
|
|
- <result column="mer_no_" jdbcType="VARCHAR" property="merNo" />
|
|
|
- <result column="max_receipt_" jdbcType="DECIMAL" property="maxReceipt" />
|
|
|
- <result column="has_receipt_" jdbcType="DECIMAL" property="hasReceipt" />
|
|
|
- <result column="channel_" jdbcType="VARCHAR" property="channel" />
|
|
|
- <result column="type_" jdbcType="CHAR" property="type" />
|
|
|
- <result column="version" jdbcType="INTEGER" property="version" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- id_,company_, mer_no_, max_receipt_, has_receipt_, channel_, type_, version
|
|
|
- </sql>
|
|
|
- <select id="get" parameterType="java.lang.Integer" resultMap="SysAccount">
|
|
|
- <!--@mbg.generated-->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from sys_account
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
- <delete id="delete" parameterType="java.lang.Integer">
|
|
|
- <!--@mbg.generated-->
|
|
|
- delete from sys_account
|
|
|
- where id_ = #{id,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.SysAccount" useGeneratedKeys="true">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into sys_account
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="company != null">
|
|
|
- company_,
|
|
|
- </if>
|
|
|
- <if test="merNo != null">
|
|
|
- mer_no_,
|
|
|
- </if>
|
|
|
- <if test="maxReceipt != null">
|
|
|
- max_receipt_,
|
|
|
- </if>
|
|
|
- <if test="hasReceipt != null">
|
|
|
- has_receipt_,
|
|
|
- </if>
|
|
|
- <if test="channel != null">
|
|
|
- channel_,
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type_,
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- version,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="company != null">
|
|
|
- #{company,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="merNo != null">
|
|
|
- #{merNo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="maxReceipt != null">
|
|
|
- #{maxReceipt,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="hasReceipt != null">
|
|
|
- #{hasReceipt,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="channel != null">
|
|
|
- #{channel,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- #{type,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- #{version,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysAccount">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update sys_account
|
|
|
- <set>
|
|
|
- <if test="company != null">
|
|
|
- company_ = #{company,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="merNo != null">
|
|
|
- mer_no_ = #{merNo,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="maxReceipt != null">
|
|
|
- max_receipt_ = #{maxReceipt,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="hasReceipt != null">
|
|
|
- has_receipt_ = #{hasReceipt,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="channel != null">
|
|
|
- channel_ = #{channel,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type_ = #{type,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="version != null">
|
|
|
- version = version+1,
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_ = #{id,jdbcType=INTEGER} AND version =#{version}
|
|
|
- </update>
|
|
|
- <!-- 获取一个私户账户 -->
|
|
|
- <select id="getPerAccount" resultMap="SysAccount">
|
|
|
- SELECT * FROM sys_account WHERE channel_ = 'YQPAY' AND type_ = 'PER'
|
|
|
- </select>
|
|
|
+ <resultMap id="SysAccount" type="com.ym.mec.biz.dal.entity.SysAccount">
|
|
|
+ <!--@Table sys_account-->
|
|
|
+ <id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
+ <result column="company_" jdbcType="VARCHAR" property="company"/>
|
|
|
+ <result column="mer_no_" jdbcType="VARCHAR" property="merNo"/>
|
|
|
+ <result column="routing_mer_no_" jdbcType="VARCHAR" property="routingMerNo"/>
|
|
|
+ <result column="max_receipt_" jdbcType="DECIMAL" property="maxReceipt"/>
|
|
|
+ <result column="has_receipt_" jdbcType="DECIMAL" property="hasReceipt"/>
|
|
|
+ <result column="channel_" jdbcType="VARCHAR" property="channel"/>
|
|
|
+ <result column="type_" jdbcType="CHAR" property="type"/>
|
|
|
+ <result column="version" jdbcType="INTEGER" property="version"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id_,
|
|
|
+ company_,
|
|
|
+ mer_no_,
|
|
|
+ routing_mer_no_,
|
|
|
+ max_receipt_,
|
|
|
+ has_receipt_,
|
|
|
+ channel_,
|
|
|
+ type_,
|
|
|
+ version
|
|
|
+ </sql>
|
|
|
+ <select id="get" parameterType="java.lang.Integer" resultMap="SysAccount">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from sys_account
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ delete from sys_account
|
|
|
+ where id_ = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.SysAccount"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sys_account
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="company != null">
|
|
|
+ company_,
|
|
|
+ </if>
|
|
|
+ <if test="merNo != null">
|
|
|
+ mer_no_,
|
|
|
+ </if>
|
|
|
+ <if test="merNo != null">
|
|
|
+ routing_mer_no_,
|
|
|
+ </if>
|
|
|
+ <if test="maxReceipt != null">
|
|
|
+ max_receipt_,
|
|
|
+ </if>
|
|
|
+ <if test="hasReceipt != null">
|
|
|
+ has_receipt_,
|
|
|
+ </if>
|
|
|
+ <if test="channel != null">
|
|
|
+ channel_,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type_,
|
|
|
+ </if>
|
|
|
+ <if test="version != null">
|
|
|
+ version,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="company != null">
|
|
|
+ #{company,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="merNo != null">
|
|
|
+ #{merNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="routingMerNo != null">
|
|
|
+ #{routingMerNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="maxReceipt != null">
|
|
|
+ #{maxReceipt,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="hasReceipt != null">
|
|
|
+ #{hasReceipt,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="channel != null">
|
|
|
+ #{channel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="version != null">
|
|
|
+ #{version,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysAccount">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update sys_account
|
|
|
+ <set>
|
|
|
+ <if test="company != null">
|
|
|
+ company_ = #{company,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="merNo != null">
|
|
|
+ mer_no_ = #{merNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="routingMerNo != null">
|
|
|
+ routing_mer_no_ = #{routingMerNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="maxReceipt != null">
|
|
|
+ max_receipt_ = #{maxReceipt,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="hasReceipt != null">
|
|
|
+ has_receipt_ = #{hasReceipt,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="channel != null">
|
|
|
+ channel_ = #{channel,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type_ = #{type,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="version != null">
|
|
|
+ version = version+1,
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id,jdbcType=INTEGER} AND version =#{version}
|
|
|
+ </update>
|
|
|
+ <!-- 获取一个私户账户 -->
|
|
|
+ <select id="getPerAccount" resultMap="SysAccount">
|
|
|
+ SELECT *
|
|
|
+ FROM sys_account
|
|
|
+ WHERE channel_ = 'YQPAY'
|
|
|
+ AND type_ = 'PER'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getAccount" resultMap="SysAccount">
|
|
|
+ SELECT * FROM sys_account WHERE company_=#{company}
|
|
|
+ <if test="channel != null">
|
|
|
+ AND channel_ = #{channel}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ AND type_ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="amount != null">
|
|
|
+ <![CDATA[AND max_receipt_ < has_receipt_+ #{amount}]]>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|