| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- <?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.usoftchina.saas.document.mapper.BankinformationMapper" >
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Bankinformation" >
- <id column="bk_id" property="id" jdbcType="INTEGER" />
- <result column="bk_bankcode" property="bk_bankcode" jdbcType="VARCHAR" />
- <result column="bk_bankname" property="bk_bankname" jdbcType="VARCHAR" />
- <result column="bk_date" property="bk_date" jdbcType="TIMESTAMP" />
- <result column="bk_type" property="bk_type" jdbcType="VARCHAR" />
- <result column="bk_beginamount" property="bk_beginamount" jdbcType="DOUBLE" />
- <result column="bk_thisamount" property="bk_thisamount" jdbcType="DOUBLE" />
- <result column="bk_status" property="bk_status" jdbcType="VARCHAR" />
- <result column="bk_statuscode" property="bk_statuscode" jdbcType="VARCHAR" />
- <result column="bk_ym" property="bk_ym" jdbcType="INTEGER" />
- <result column="companyid" property="companyId" jdbcType="INTEGER" />
- <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
- <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="bk_text1" property="bk_text1" jdbcType="VARCHAR" />
- <result column="bk_text2" property="bk_text2" jdbcType="VARCHAR" />
- <result column="bk_text3" property="bk_text3" jdbcType="VARCHAR" />
- <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
- <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
- <result column="bk_remark" property="bk_remark" jdbcType="VARCHAR" />
- <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
- <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
- </resultMap>
- <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
- <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,
- bk_status, bk_statuscode, bk_ym, companyid,
- updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark
- </sql>
- <sql id="Blob_Column_List" >
- bk_remark
- </sql>
- <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from bankinformation
- where bk_id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from bankinformation
- where bk_id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
- insert into bankinformation (bk_id, bk_bankcode, bk_bankname,
- bk_date, bk_type, bk_beginamount,
- bk_thisamount, bk_status, bk_statuscode,
- bk_ym, companyid, updaterId,
- updateTime, bk_text1, bk_text2,
- bk_text3, bk_text4, bk_text5,
- bk_remark,
- creatorId,createTime,creatorName)
- values (#{bk_bankcode,jdbcType=VARCHAR}, #{bk_bankname,jdbcType=VARCHAR},
- #{bk_date,jdbcType=TIMESTAMP}, #{bk_type,jdbcType=VARCHAR}, #{bk_beginamount,jdbcType=DOUBLE},
- #{bk_thisamount,jdbcType=DOUBLE}, #{bk_status,jdbcType=VARCHAR}, #{bk_statuscode,jdbcType=VARCHAR},
- #{bk_ym,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
- #{updateTime,jdbcType=TIMESTAMP}, #{bk_text1,jdbcType=VARCHAR}, #{bk_text2,jdbcType=VARCHAR},
- #{bk_text3,jdbcType=VARCHAR}, #{bk_text4,jdbcType=VARCHAR}, #{bk_text5,jdbcType=VARCHAR},
- #{bk_remark,jdbcType=LONGVARCHAR},
- #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
- insert into bankinformation
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="bk_bankcode != null" >
- bk_bankcode,
- </if>
- <if test="bk_bankname != null" >
- bk_bankname,
- </if>
- <if test="bk_date != null" >
- bk_date,
- </if>
- <if test="bk_type != null" >
- bk_type,
- </if>
- <if test="bk_beginamount != null" >
- bk_beginamount,
- </if>
- <if test="bk_thisamount != null" >
- bk_thisamount,
- </if>
- <if test="bk_status != null" >
- bk_status,
- </if>
- <if test="bk_statuscode != null" >
- bk_statuscode,
- </if>
- <if test="bk_ym != null" >
- bk_ym,
- </if>
- <if test="companyId != null" >
- companyid,
- </if>
- <if test="updaterId != null" >
- updaterId,
- </if>
- <if test="updateTime != null" >
- updateTime,
- </if>
- <if test="bk_text1 != null" >
- bk_text1,
- </if>
- <if test="bk_text2 != null" >
- bk_text2,
- </if>
- <if test="bk_text3 != null" >
- bk_text3,
- </if>
- <if test="bk_text4 != null" >
- bk_text4,
- </if>
- <if test="bk_text5 != null" >
- bk_text5,
- </if>
- <if test="bk_remark != null" >
- bk_remark,
- </if>
- <if test="bk_spending != null" >
- bk_spending,
- </if>
- <if test="bk_income != null" >
- bk_income,
- </if>
- <if test="creatorId != null" >
- creatorId,
- </if>
- <if test="createTime != null" >
- createTime,
- </if>
- <if test="creatorName != null" >
- creatorName,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="bk_bankcode != null" >
- #{bk_bankcode,jdbcType=VARCHAR},
- </if>
- <if test="bk_bankname != null" >
- #{bk_bankname,jdbcType=VARCHAR},
- </if>
- <if test="bk_date != null" >
- #{bk_date,jdbcType=TIMESTAMP},
- </if>
- <if test="bk_type != null" >
- #{bk_type,jdbcType=VARCHAR},
- </if>
- <if test="bk_beginamount != null" >
- #{bk_beginamount,jdbcType=DOUBLE},
- </if>
- <if test="bk_thisamount != null" >
- #{bk_thisamount,jdbcType=DOUBLE},
- </if>
- <if test="bk_status != null" >
- #{bk_status,jdbcType=VARCHAR},
- </if>
- <if test="bk_statuscode != null" >
- #{bk_statuscode,jdbcType=VARCHAR},
- </if>
- <if test="bk_ym != null" >
- #{bk_ym,jdbcType=INTEGER},
- </if>
- <if test="companyId != null" >
- #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null" >
- #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bk_text1 != null" >
- #{bk_text1,jdbcType=VARCHAR},
- </if>
- <if test="bk_text2 != null" >
- #{bk_text2,jdbcType=VARCHAR},
- </if>
- <if test="bk_text3 != null" >
- #{bk_text3,jdbcType=VARCHAR},
- </if>
- <if test="bk_text4 != null" >
- #{bk_text4,jdbcType=VARCHAR},
- </if>
- <if test="bk_text5 != null" >
- #{bk_text5,jdbcType=VARCHAR},
- </if>
- <if test="bk_remark != null" >
- #{bk_remark,jdbcType=LONGVARCHAR},
- </if>
- <if test="bk_spending != null" >
- #{bk_spending,jdbcType=DOUBLE},
- </if>
- <if test="bk_income != null" >
- #{bk_income,jdbcType=DOUBLE},
- </if>
- <if test="creatorId != null" >
- #{creatorId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="creatorName != null" >
- #{creatorName,jdbcType=VARCHAR},
- </if>
- </trim>
- <selectKey resultType="Long" keyProperty="id" order="AFTER">
- SELECT LAST_INSERT_ID()
- </selectKey>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
- update bankinformation
- <set >
- <if test="bk_bankcode != null" >
- bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR},
- </if>
- <if test="bk_bankname != null" >
- bk_bankname = #{bk_bankname,jdbcType=VARCHAR},
- </if>
- <if test="bk_date != null" >
- bk_date = #{bk_date,jdbcType=TIMESTAMP},
- </if>
- <if test="bk_type != null" >
- bk_type = #{bk_type,jdbcType=VARCHAR},
- </if>
- <if test="bk_beginamount != null" >
- bk_beginamount = #{bk_beginamount,jdbcType=DOUBLE},
- </if>
- <if test="bk_thisamount != null" >
- bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE},
- </if>
- <if test="bk_status != null" >
- bk_status = #{bk_status,jdbcType=VARCHAR},
- </if>
- <if test="bk_statuscode != null" >
- bk_statuscode = #{bk_statuscode,jdbcType=VARCHAR},
- </if>
- <if test="bk_ym != null" >
- bk_ym = #{bk_ym,jdbcType=INTEGER},
- </if>
- <if test="companyId != null" >
- companyid = #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null" >
- updaterId = #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- updateTime = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bk_text1 != null" >
- bk_text1 = #{bk_text1,jdbcType=VARCHAR},
- </if>
- <if test="bk_text2 != null" >
- bk_text2 = #{bk_text2,jdbcType=VARCHAR},
- </if>
- <if test="bk_text3 != null" >
- bk_text3 = #{bk_text3,jdbcType=VARCHAR},
- </if>
- <if test="bk_text4 != null" >
- bk_text4 = #{bk_text4,jdbcType=VARCHAR},
- </if>
- <if test="bk_text5 != null" >
- bk_text5 = #{bk_text5,jdbcType=VARCHAR},
- </if>
- <if test="bk_remark != null" >
- bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
- </if>
- <if test="bk_income != null" >
- bk_income = #{bk_income,jdbcType=DOUBLE},
- </if>
- <if test="bk_spending != null" >
- bk_spending = #{bk_spending,jdbcType=DOUBLE},
- </if>
- </set>
- where bk_id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
- update bankinformation
- set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
- bk_bankname = #{bkBankname,jdbcType=VARCHAR},
- bk_date = #{bkDate,jdbcType=TIMESTAMP},
- bk_type = #{bkType,jdbcType=VARCHAR},
- bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
- bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
- bk_status = #{bkStatus,jdbcType=VARCHAR},
- bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
- bk_ym = #{bkYm,jdbcType=INTEGER},
- companyid = #{companyId,jdbcType=INTEGER},
- updaterId = #{updaterId,jdbcType=INTEGER},
- updateTime = #{updateTime,jdbcType=TIMESTAMP},
- bk_text1 = #{bkText1,jdbcType=VARCHAR},
- bk_text2 = #{bkText2,jdbcType=VARCHAR},
- bk_text3 = #{bkText3,jdbcType=VARCHAR},
- bk_text4 = #{bkText4,jdbcType=VARCHAR},
- bk_text5 = #{bkText5,jdbcType=VARCHAR},
- bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
- where bk_id = #{bkId,jdbcType=INTEGER}
- </update>
- <select id="selectAll" resultMap="BaseResultMap">
- SELECT * FROM bankinformation
- </select>
- <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from bankinformation
- <where>
- <if test="con != null">
- ${con}
- </if>
- <if test="companyId != null">
- and bankinformation.companyId = #{companyId}
- </if>
- </where> order by bk_date desc, bk_id desc
- </select>
- <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
- SELECT CONCAT(bk_bankcode,' ',bk_bankname) display,bk_bankname value FROM bankinformation WHERE COMPANYID=#{companyId}
- </select>
- <select id="selectBankcode" resultType="java.lang.String">
- select bk_bankcode from bankinformation where
- bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
- </select>
- <select id="selectBankId" resultType="java.lang.Long">
- select bk_id from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
- </select>
- <select id="selectamount" parameterType="java.lang.Long" resultType="java.lang.Double">
- select bk_beginamount from bankinformation where bk_id = #{bk_id,jdbcType=INTEGER}
- </select>
- <select id="check" parameterMap="checkParamMap" statementType="CALLABLE">
- CALL SP_LIMITBASE(?, ?, ?, ?,?)
- </select>
- <parameterMap id="checkParamMap" type="java.util.Map">
- <parameter property="v_type" jdbcType="VARCHAR" mode="IN" />
- <parameter property="v_id" jdbcType="INTEGER" mode="IN" />
- <parameter property="v_code" jdbcType="VARCHAR" mode="IN" />
- <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
- <parameter property="v_res" jdbcType="VARCHAR" mode="OUT" />
- </parameterMap>
- <select id="validateCodeWhenInsert" resultType="int">
- select count(*) from bankinformation where bk_bankcode = #{code} and companyId =#{companyId}
- </select>
- <select id="validateCodeWhenUpdate" resultType="int" >
- select count(*) from bankinformation where bk_bankcode = #{code} and bk_id != #{id} and companyId =#{companyId}
- </select>
- </mapper>
|