|
|
@@ -1,509 +1,287 @@
|
|
|
-<?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.VendorMapper">
|
|
|
- <resultMap id="VendorResultMapper" type="com.usoftchina.saas.document.entities.Vendor">
|
|
|
- <id column="ve_id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
|
|
|
- <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
|
|
|
- <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
|
|
|
- <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
|
|
|
- <result column="companyId" property="companyId" jdbcType="INTEGER" />
|
|
|
- <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
|
|
|
- <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
|
|
|
- <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
|
|
|
- </resultMap>
|
|
|
- <resultMap id="VendorDTOResultMapper" type="com.usoftchina.saas.document.dto.VendorDTO">
|
|
|
- <id column="ve_id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
|
|
|
- <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
|
|
|
- </resultMap>
|
|
|
+<?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.VendApamountMapper">
|
|
|
|
|
|
- <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper">
|
|
|
- SELECT * FROM VENDOR
|
|
|
- <where>
|
|
|
- <if test="condition!=null">
|
|
|
- ${condition}
|
|
|
- </if>
|
|
|
- <if test="companyId!=null">
|
|
|
- AND companyId = #{companyId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY VE_ID DESC
|
|
|
- </select>
|
|
|
+ <resultMap id="VendApamountResultMapper" type="com.usoftchina.saas.document.entities.VendApamount">
|
|
|
+ <id column="va_id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="va_vendid" jdbcType="INTEGER" property="va_vendid" />
|
|
|
+ <result column="va_vendcode" jdbcType="VARCHAR" property="va_vendcode" />
|
|
|
+ <result column="va_vendname" jdbcType="VARCHAR" property="va_vendname" />
|
|
|
+ <result column="va_currency" jdbcType="VARCHAR" property="va_currency" />
|
|
|
+ <result column="va_begindate" jdbcType="TIMESTAMP" property="va_begindate" />
|
|
|
+ <result column="va_beginapamount" jdbcType="DOUBLE" property="va_beginapamount" />
|
|
|
+ <result column="va_beginprepayamount" jdbcType="DOUBLE" property="va_beginprepayamount" />
|
|
|
+ <result column="va_payamount" jdbcType="DOUBLE" property="va_payamount" />
|
|
|
+ <result column="va_preamount" jdbcType="DOUBLE" property="va_preamount" />
|
|
|
+ <result column="va_leftamount" jdbcType="DOUBLE" property="va_leftamount" />
|
|
|
+ <result column="companyId" jdbcType="INTEGER" property="companyId" />
|
|
|
+ <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
|
|
|
+ <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
|
|
|
+ <result column="creatorId" jdbcType="INTEGER" property="creatorId" />
|
|
|
+ <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">
|
|
|
- <id column="ve_id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_shortname" property="ve_shortname" jdbcType="VARCHAR"/>
|
|
|
- <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
|
|
|
- <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
|
|
|
- <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
|
|
|
- <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_leftamount" property="ve_leftamount" jdbcType="INTEGER" />
|
|
|
- <result column="ve_address" property="ve_address" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_remark" property="ve_remark" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_buyerid" property="ve_buyerid" jdbcType="INTEGER" />
|
|
|
- <result column="ve_buyercode" property="ve_buyercode" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_buyername" property="ve_buyername" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_veid" property="vc_veid" jdbcType="INTEGER" />
|
|
|
- <result column="vc_detno" property="vc_detno" jdbcType="INTEGER" />
|
|
|
- <result column="vc_name" property="vc_name" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_tel" property="vc_tel" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_qq" property="vc_qq" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_email" property="vc_email" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
|
|
|
- <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
|
|
|
- <result column="ve_currency" property="ve_currency" jdbcType="VARCHAR" />
|
|
|
- <result column="cr_rate" property="cr_rate" jdbcType="DOUBLE" />
|
|
|
+ <resultMap id="VendApamountListResultMapper" type="com.usoftchina.saas.document.entities.VendApamountList">
|
|
|
+ <id column="va_id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="va_vendid" jdbcType="INTEGER" property="va_vendid" />
|
|
|
+ <result column="va_vendcode" jdbcType="VARCHAR" property="va_vendcode" />
|
|
|
+ <result column="va_vendname" jdbcType="VARCHAR" property="va_vendname" />
|
|
|
+ <result column="va_currency" jdbcType="VARCHAR" property="va_currency" />
|
|
|
+ <result column="va_begindate" jdbcType="TIMESTAMP" property="va_begindate" />
|
|
|
+ <result column="va_beginapamount" jdbcType="DOUBLE" property="va_beginapamount" />
|
|
|
+ <result column="va_beginprepayamount" jdbcType="DOUBLE" property="va_beginprepayamount" />
|
|
|
+ <result column="va_payamount" jdbcType="DOUBLE" property="va_payamount" />
|
|
|
+ <result column="va_preamount" jdbcType="DOUBLE" property="va_preamount" />
|
|
|
+ <result column="va_leftamount" jdbcType="DOUBLE" property="va_leftamount" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="getListDataByCondition" resultMap="VendorListResultMapper">
|
|
|
- SELECT * FROM VENDOR
|
|
|
- LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID and vc_default = 1
|
|
|
- left join currencys on cr_name = ve_currency and currencys.companyid = VENDOR.companyid
|
|
|
+ <select id="getListDataByCondition" resultMap="VendApamountListResultMapper">
|
|
|
+ SELECT * FROM VendApamount
|
|
|
<where>
|
|
|
<if test="condition!=null">
|
|
|
${condition}
|
|
|
</if>
|
|
|
- AND VENDOR.COMPANYID = #{companyId}
|
|
|
+ AND VENDAPAMOUNT.COMPANYID = #{companyId}
|
|
|
+ AND VENDAPAMOUNT.VA_BEGINDATE IS NOT NULL
|
|
|
</where>
|
|
|
- order by VE_ID DESC
|
|
|
+ order by VA_ID DESC
|
|
|
</select>
|
|
|
|
|
|
- <sql id="Base_Column_List" >
|
|
|
- ve_id, ve_code, ve_shortname,ve_name, ve_uu, ve_type, ve_begindate, ve_beginapamount, ve_beginprepayamount,
|
|
|
- ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
|
|
|
- vendor.companyId companyId, vendor.updaterId updaterId, vendor.updateTime updateTime, ve_text1,
|
|
|
- ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym, ve_preamount,ve_remark,
|
|
|
- ve_buyerid,ve_buyercode,ve_buyername,ve_address,ve_currency,cr_rate
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ va_id, va_vendid, va_vendcode, va_vendname, va_currency, va_begindate, va_beginapamount,
|
|
|
+ va_beginprepayamount, va_payamount, va_preamount, va_leftamount, companyId, updaterId,
|
|
|
+ updateTime, creatorName, creatorId, createTime, updaterName
|
|
|
</sql>
|
|
|
- <select id="selectByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
|
|
|
+
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="VendApamountResultMapper">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
- from vendor left join currencys on cr_name = ve_currency and vendor.companyId = currencys.companyId
|
|
|
- where ve_id = #{id}
|
|
|
+ from vendapamount
|
|
|
+ where va_id = #{id}
|
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
- delete from vendor
|
|
|
- where ve_id = #{id}
|
|
|
+
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete from vendapamount
|
|
|
+ where va_id = #{id}
|
|
|
</delete>
|
|
|
- <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
|
|
|
+
|
|
|
+ <select id="selectPeriod" resultType="string">
|
|
|
+ select PD_DETNO from periodsdetail where companyid=#{companyId} and pd_detno is not null and pd_status=0 order by PD_DETNO LIMIT 1;
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.VendApamount">
|
|
|
<selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
SELECT LAST_INSERT_ID() AS ID
|
|
|
</selectKey>
|
|
|
- insert into vendor
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="ve_code != null" >
|
|
|
- ve_code,
|
|
|
- </if>
|
|
|
- <if test="ve_shortname !=null">
|
|
|
- ve_shortname,
|
|
|
- </if>
|
|
|
- <if test="ve_name != null" >
|
|
|
- ve_name,
|
|
|
- </if>
|
|
|
- <if test="ve_uu != null" >
|
|
|
- ve_uu,
|
|
|
+ insert into vendapamount
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="va_vendid != null">
|
|
|
+ va_vendid,
|
|
|
</if>
|
|
|
- <if test="ve_type != null" >
|
|
|
- ve_type,
|
|
|
+ <if test="va_vendcode != null">
|
|
|
+ va_vendcode,
|
|
|
</if>
|
|
|
- <if test="ve_begindate != null" >
|
|
|
- ve_begindate,
|
|
|
+ <if test="va_vendname != null">
|
|
|
+ va_vendname,
|
|
|
</if>
|
|
|
- <if test="ve_beginapamount != null" >
|
|
|
- ve_beginapamount,
|
|
|
+ <if test="va_currency != null">
|
|
|
+ va_currency,
|
|
|
</if>
|
|
|
- <if test="ve_beginprepayamount != null" >
|
|
|
- ve_beginprepayamount,
|
|
|
+ <if test="va_begindate != null">
|
|
|
+ va_begindate,
|
|
|
</if>
|
|
|
- <if test="ve_promisedays != null" >
|
|
|
- ve_promisedays,
|
|
|
+ <if test="va_beginapamount != null">
|
|
|
+ va_beginapamount,
|
|
|
</if>
|
|
|
- <if test="ve_taxrate != null" >
|
|
|
- ve_taxrate,
|
|
|
+ <if test="va_beginprepayamount != null">
|
|
|
+ va_beginprepayamount,
|
|
|
</if>
|
|
|
- <if test="ve_nsrzh != null" >
|
|
|
- ve_nsrzh,
|
|
|
+ <if test="va_payamount != null">
|
|
|
+ va_payamount,
|
|
|
</if>
|
|
|
- <if test="ve_bankaccount != null" >
|
|
|
- ve_bankaccount,
|
|
|
+ <if test="va_preamount != null">
|
|
|
+ va_preamount,
|
|
|
</if>
|
|
|
- <if test="ve_bankcode != null" >
|
|
|
- ve_bankcode,
|
|
|
+ <if test="va_leftamount != null">
|
|
|
+ va_leftamount,
|
|
|
</if>
|
|
|
- <if test="ve_status != null" >
|
|
|
- ve_status,
|
|
|
- </if>
|
|
|
- <if test="ve_statuscode != null" >
|
|
|
- ve_statuscode,
|
|
|
- </if>
|
|
|
- <if test="companyId != null" >
|
|
|
+ <if test="companyId != null">
|
|
|
companyId,
|
|
|
</if>
|
|
|
- <if test="updaterId != null" >
|
|
|
+ <if test="updaterId != null">
|
|
|
updaterId,
|
|
|
</if>
|
|
|
- <if test="updateTime != null" >
|
|
|
+ <if test="updateTime != null">
|
|
|
updateTime,
|
|
|
</if>
|
|
|
- <if test="ve_text1 != null" >
|
|
|
- ve_text1,
|
|
|
- </if>
|
|
|
- <if test="ve_text2 != null" >
|
|
|
- ve_text2,
|
|
|
- </if>
|
|
|
- <if test="ve_text3 != null" >
|
|
|
- ve_text3,
|
|
|
- </if>
|
|
|
- <if test="ve_text4 != null" >
|
|
|
- ve_text4,
|
|
|
- </if>
|
|
|
- <if test="ve_text5 != null" >
|
|
|
- ve_text5,
|
|
|
- </if>
|
|
|
- <if test="ve_payamount != null" >
|
|
|
- ve_payamount,
|
|
|
- </if>
|
|
|
- <if test="ve_leftamount != null" >
|
|
|
- ve_leftamount,
|
|
|
- </if>
|
|
|
- <if test="ve_beginym != null" >
|
|
|
- ve_beginym,
|
|
|
- </if>
|
|
|
- <if test="ve_preamount !=null" >
|
|
|
- ve_preamount,
|
|
|
+ <if test="creatorName != null">
|
|
|
+ creatorName,
|
|
|
</if>
|
|
|
- <if test="creatorId != null" >
|
|
|
+ <if test="creatorId != null">
|
|
|
creatorId,
|
|
|
</if>
|
|
|
- <if test="createTime != null" >
|
|
|
+ <if test="createTime != null">
|
|
|
createTime,
|
|
|
</if>
|
|
|
- <if test="creatorName != null" >
|
|
|
- creatorName,
|
|
|
- </if>
|
|
|
- <if test="ve_remark!=null">
|
|
|
- ve_remark,
|
|
|
- </if>
|
|
|
- <if test="ve_buyerid!=null">
|
|
|
- ve_buyerid,
|
|
|
- </if>
|
|
|
- <if test="ve_buyercode!=null">
|
|
|
- ve_buyercode,
|
|
|
- </if>
|
|
|
- <if test="ve_buyername!=null">
|
|
|
- ve_buyername,
|
|
|
- </if>
|
|
|
- <if test="ve_address!=null">
|
|
|
- ve_address,
|
|
|
- </if>
|
|
|
- <if test="ve_currency!=null">
|
|
|
- ve_currency,
|
|
|
+ <if test="updaterName != null">
|
|
|
+ updaterName,
|
|
|
</if>
|
|
|
</trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="ve_code != null" >
|
|
|
- #{ve_code,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_shortname !=null">
|
|
|
- #{ve_shortname,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_name != null" >
|
|
|
- #{ve_name,jdbcType=VARCHAR},
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="va_vendid != null">
|
|
|
+ #{va_vendid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="ve_uu != null" >
|
|
|
- #{ve_uu,jdbcType=VARCHAR},
|
|
|
+ <if test="va_vendcode != null">
|
|
|
+ #{va_vendcode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="ve_type != null" >
|
|
|
- #{ve_type,jdbcType=VARCHAR},
|
|
|
+ <if test="va_vendname != null">
|
|
|
+ #{va_vendname,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="ve_begindate != null" >
|
|
|
- #{ve_begindate,jdbcType=TIMESTAMP},
|
|
|
+ <if test="va_currency != null">
|
|
|
+ #{va_currency,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="ve_beginapamount != null" >
|
|
|
- #{ve_beginapamount,jdbcType=DOUBLE},
|
|
|
+ <if test="va_begindate != null">
|
|
|
+ #{va_begindate,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="ve_beginprepayamount != null" >
|
|
|
- #{ve_beginprepayamount,jdbcType=DOUBLE},
|
|
|
+ <if test="va_beginapamount != null">
|
|
|
+ #{va_beginapamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_promisedays != null" >
|
|
|
- #{ve_promisedays,jdbcType=DECIMAL},
|
|
|
+ <if test="va_beginprepayamount != null">
|
|
|
+ #{va_beginprepayamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_taxrate != null" >
|
|
|
- #{ve_taxrate,jdbcType=DOUBLE},
|
|
|
+ <if test="va_payamount != null">
|
|
|
+ #{va_payamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_nsrzh != null" >
|
|
|
- #{ve_nsrzh,jdbcType=VARCHAR},
|
|
|
+ <if test="va_preamount != null">
|
|
|
+ #{va_preamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_bankaccount != null" >
|
|
|
- #{ve_bankaccount,jdbcType=VARCHAR},
|
|
|
+ <if test="va_leftamount != null">
|
|
|
+ #{va_leftamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_bankcode != null" >
|
|
|
- #{ve_bankcode,jdbcType=VARCHAR},
|
|
|
+ <if test="companyId != null">
|
|
|
+ #{companyId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="ve_status != null" >
|
|
|
- #{ve_status,jdbcType=VARCHAR},
|
|
|
+ <if test="updaterId != null">
|
|
|
+ #{updaterId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="ve_statuscode != null" >
|
|
|
- #{ve_statuscode,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="companyId != null" >
|
|
|
- #{companyId,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="updaterId != null" >
|
|
|
- #{updaterId,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null" >
|
|
|
+ <if test="updateTime != null">
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="ve_text1 != null" >
|
|
|
- #{ve_text1,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text2 != null" >
|
|
|
- #{ve_text2,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text3 != null" >
|
|
|
- #{ve_text3,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text4 != null" >
|
|
|
- #{ve_text4,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text5 != null" >
|
|
|
- #{ve_text5,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_payamount != null" >
|
|
|
- #{ve_payamount,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="ve_leftamount != null" >
|
|
|
- #{ve_leftamount,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="ve_beginym != null" >
|
|
|
- #{ve_beginym,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="ve_preamount !=null" >
|
|
|
- #{ve_preamount,jdbcType=DOUBLE},
|
|
|
+ <if test="creatorName != null">
|
|
|
+ #{creatorName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="creatorId != null" >
|
|
|
+ <if test="creatorId != null">
|
|
|
#{creatorId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="createTime != null" >
|
|
|
+ <if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="creatorName != null" >
|
|
|
- #{creatorName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_remark != null">
|
|
|
- #{ve_remark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_buyerid != null">
|
|
|
- #{ve_buyerid,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="ve_buyercode != null">
|
|
|
- #{ve_buyercode,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_buyername != null">
|
|
|
- #{ve_buyername,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_address != null">
|
|
|
- #{ve_address,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_currency != null">
|
|
|
- #{ve_currency,jdbcType=VARCHAR},
|
|
|
+ <if test="updaterName != null">
|
|
|
+ #{updaterName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Vendor" >
|
|
|
- update vendor
|
|
|
- <set >
|
|
|
- <if test="ve_code != null" >
|
|
|
- ve_code = #{ve_code,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_shortname !=null">
|
|
|
- ve_shortname = #{ve_shortname,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_name != null" >
|
|
|
- ve_name = #{ve_name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_uu != null" >
|
|
|
- ve_uu = #{ve_uu,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_type != null" >
|
|
|
- ve_type = #{ve_type,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_begindate != null" >
|
|
|
- ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="ve_beginapamount != null" >
|
|
|
- ve_beginapamount = #{ve_beginapamount,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="ve_beginprepayamount != null" >
|
|
|
- ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="ve_promisedays != null" >
|
|
|
- ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="ve_taxrate != null" >
|
|
|
- ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="ve_nsrzh != null" >
|
|
|
- ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_bankaccount != null" >
|
|
|
- ve_bankaccount = #{ve_bankaccount,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_bankcode != null" >
|
|
|
- ve_bankcode = #{ve_bankcode,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_status != null" >
|
|
|
- ve_status = #{ve_status,jdbcType=VARCHAR},
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.VendApamount">
|
|
|
+ update vendapamount
|
|
|
+ <set>
|
|
|
+ <if test="va_beginapamount != null">
|
|
|
+ va_beginapamount = #{va_beginapamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="ve_statuscode != null" >
|
|
|
- ve_statuscode = #{ve_statuscode,jdbcType=VARCHAR},
|
|
|
+ <if test="va_beginprepayamount != null">
|
|
|
+ va_beginprepayamount = #{va_beginprepayamount,jdbcType=DOUBLE},
|
|
|
</if>
|
|
|
- <if test="companyId != null" >
|
|
|
- companyId = #{companyId,jdbcType=DECIMAL},
|
|
|
+ <if test="updaterId != null">
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="updaterId != null" >
|
|
|
- updaterId = #{updaterId,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null" >
|
|
|
+ <if test="updateTime != null">
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="ve_text1 != null" >
|
|
|
- ve_text1 = #{ve_text1,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text2 != null" >
|
|
|
- ve_text2 = #{ve_text2,jdbcType=VARCHAR},
|
|
|
+ <if test="updaterName != null">
|
|
|
+ updaterName = #{updaterName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="ve_text3 != null" >
|
|
|
- ve_text3 = #{ve_text3,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ve_text4 != null" >
|
|
|
- ve_text4 = #{ve_text4,jdbcType=VARCHAR},
|
|
|
+ </set>
|
|
|
+ where va_id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="checkBeginData" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM periodsdetail
|
|
|
+ <where>
|
|
|
+ pd_status = 99
|
|
|
+ <if test="pd_detno!=null">
|
|
|
+ and pd_detno=#{pd_detno}
|
|
|
</if>
|
|
|
- <if test="ve_text5 != null" >
|
|
|
- ve_text5 = #{ve_text5,jdbcType=VARCHAR},
|
|
|
+ <if test="companyId!=0 and companyId!=null">
|
|
|
+ and COMPANYID=#{companyId}
|
|
|
</if>
|
|
|
- <if test="ve_payamount != null" >
|
|
|
- ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getVendApamount" resultMap="VendApamountResultMapper">
|
|
|
+ SELECT * FROM vendapamount
|
|
|
+ <where>
|
|
|
+ <if test="id!=null">
|
|
|
+ and va_id=#{id}
|
|
|
</if>
|
|
|
- <if test="ve_leftamount != null" >
|
|
|
- ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
|
|
|
+ <if test="companyId!=0 and companyId!=null">
|
|
|
+ and COMPANYID=#{companyId}
|
|
|
</if>
|
|
|
- <if test="ve_beginym != null" >
|
|
|
- ve_beginym = #{ve_beginym,jdbcType=INTEGER},
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="hasVendCode" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM vendor
|
|
|
+ <where>
|
|
|
+ ve_statuscode = 'ENABLE'
|
|
|
+ <if test="name!=null">
|
|
|
+ and VE_CODE=#{name}
|
|
|
</if>
|
|
|
- <if test="ve_preamount !=null" >
|
|
|
- #{ve_preamount,jdbcType=DOUBLE},
|
|
|
+ <if test="companyId!=0 and companyId!=null">
|
|
|
+ and COMPANYID=#{companyId}
|
|
|
</if>
|
|
|
- <if test="ve_remark != null" >
|
|
|
- ve_remark = #{ve_remark,jdbcType=VARCHAR},
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="hasCurrency" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM currencys
|
|
|
+ <where>
|
|
|
+ <if test="name!=null">
|
|
|
+ and cr_name=#{name}
|
|
|
</if>
|
|
|
- <if test="ve_buyerid != null" >
|
|
|
- ve_buyerid = #{ve_buyerid,jdbcType=INTEGER},
|
|
|
+ <if test="companyId!=0 and companyId!=null">
|
|
|
+ and COMPANYID=#{companyId}
|
|
|
</if>
|
|
|
- <if test="ve_buyercode != null" >
|
|
|
- ve_buyercode = #{ve_buyercode,jdbcType=VARCHAR},
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="validVendCodeAndCurrency" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM vendapamount
|
|
|
+ <where>
|
|
|
+ <if test="vendcode!=null">
|
|
|
+ and va_vendcode=#{vendcode}
|
|
|
</if>
|
|
|
- <if test="ve_buyername != null" >
|
|
|
- ve_buyername = #{ve_buyername,jdbcType=VARCHAR},
|
|
|
+ <if test="currency!=null">
|
|
|
+ and va_currency=#{currency}
|
|
|
</if>
|
|
|
- <if test="ve_address != null">
|
|
|
- ve_address = #{ve_address,jdbcType=VARCHAR},
|
|
|
+ <if test="id!=0">
|
|
|
+ and va_id!=#{id}
|
|
|
</if>
|
|
|
- <if test="ve_currency != null">
|
|
|
- ve_currency = #{ve_currency,jdbcType=VARCHAR},
|
|
|
+ <if test="companyId!=0 and companyId!=null">
|
|
|
+ and COMPANYID=#{companyId}
|
|
|
</if>
|
|
|
- </set>
|
|
|
- where ve_id = #{id}
|
|
|
- </update>
|
|
|
- <select id="validateCodeWhenInsert" resultType="int">
|
|
|
- select count(*) from VENDOR where VE_CODE = #{code} and companyId =#{companyId}
|
|
|
- </select>
|
|
|
- <select id="validateCodeWhenUpdate" resultType="int" >
|
|
|
- select count(*) from VENDOR where VE_CODE = #{code} and VE_ID != #{id} and companyId =#{companyId}
|
|
|
- </select>
|
|
|
- <select id="getCodeById" resultType="string">
|
|
|
- SELECT VE_CODE FROM VENDOR WHERE VE_ID = #{id} and COMPANYID = #{companyId}
|
|
|
- </select>
|
|
|
- <select id="getCountByCode" resultType="int">
|
|
|
- SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_CODE=#{code}
|
|
|
- </select>
|
|
|
- <select id="getCountByName" resultType="int">
|
|
|
- SELECT COUNT(*) FROM VENDOR WHERE COMPANYID = #{companyId} AND VE_NAME=#{name}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="validFinish" parameterType="long" resultType="int">
|
|
|
- select count(1) from periodsdetail where pd_status=99 and pd_detno=(select DATE_FORMAT(ve_begindate,'%Y%m') from vendor where ve_id =#{id})
|
|
|
- and companyId =#{companyId};
|
|
|
- </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="selectIdByCode" resultType="long">
|
|
|
- select ve_id from VENDOR where ve_code=#{code} and companyId=#{companyId}
|
|
|
- </select>
|
|
|
- <select id="selectByUU" resultMap="VendorDTOResultMapper">
|
|
|
- select * from vendor where ve_uu = #{uu} and companyId = #{companyId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByName" resultMap="VendorDTOResultMapper">
|
|
|
- select * from vendor where ve_name = #{name} and companyId = #{companyId}
|
|
|
+ </where>
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
|
|
|
+</mapper>
|