|
|
@@ -0,0 +1,244 @@
|
|
|
+<?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.money.mapper.SubledgerMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Subledger" >
|
|
|
+ <id column="sl_id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="sl_code" property="sl_code" jdbcType="VARCHAR" />
|
|
|
+ <result column="sl_kind" property="sl_kind" jdbcType="VARCHAR" />
|
|
|
+ <result column="sl_custid" property="sl_custid" jdbcType="INTEGER" />
|
|
|
+ <result column="sl_vendid" property="sl_vendid" jdbcType="INTEGER" />
|
|
|
+ <result column="sl_date" property="sl_date" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="sl_amount" property="sl_amount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_preamount" property="sl_preamount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_yamount" property="sl_yamount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_namount" property="sl_namount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_remark" property="sl_remark" 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="sl_orderamount" property="sl_orderamount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
|
|
|
+ <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount,
|
|
|
+ sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount,
|
|
|
+ sl_discount, sl_ym
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from subledger
|
|
|
+ where sl_id = #{sl_id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
+ delete from subledger
|
|
|
+ where sl_code = #{code,jdbcType=VARCHAR} and sl_kind = #{kind, jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.money.po.Subledger" >
|
|
|
+ insert into subledger (sl_id, sl_code, sl_kind,
|
|
|
+ sl_custid, sl_vendid, sl_date,
|
|
|
+ sl_amount, sl_preamount, sl_yamount,
|
|
|
+ sl_namount, sl_remark, companyId,
|
|
|
+ updaterId, updateTime, sl_orderamount,
|
|
|
+ sl_discount, sl_ym)
|
|
|
+ values (#{sl_id,jdbcType=INTEGER}, #{sl_code,jdbcType=VARCHAR}, #{sl_kind,jdbcType=VARCHAR},
|
|
|
+ #{sl_custid,jdbcType=INTEGER}, #{sl_vendid,jdbcType=INTEGER}, #{sl_date,jdbcType=TIMESTAMP},
|
|
|
+ #{sl_amount,jdbcType=DOUBLE}, #{sl_preamount,jdbcType=DOUBLE}, #{sl_yamount,jdbcType=DOUBLE},
|
|
|
+ #{sl_namount,jdbcType=DOUBLE}, #{sl_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
|
|
|
+ #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{sl_orderamount,jdbcType=DOUBLE},
|
|
|
+ #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
|
|
|
+ insert into subledger
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="sl_code != null" >
|
|
|
+ sl_code,
|
|
|
+ </if>
|
|
|
+ <if test="sl_kind != null" >
|
|
|
+ sl_kind,
|
|
|
+ </if>
|
|
|
+ <if test="sl_custid != null" >
|
|
|
+ sl_custid,
|
|
|
+ </if>
|
|
|
+ <if test="sl_vendid != null" >
|
|
|
+ sl_vendid,
|
|
|
+ </if>
|
|
|
+ <if test="sl_date != null" >
|
|
|
+ sl_date,
|
|
|
+ </if>
|
|
|
+ <if test="sl_amount != null" >
|
|
|
+ sl_amount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_preamount != null" >
|
|
|
+ sl_preamount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_yamount != null" >
|
|
|
+ sl_yamount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_namount != null" >
|
|
|
+ sl_namount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_remark != null" >
|
|
|
+ sl_remark,
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null" >
|
|
|
+ companyId,
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="sl_orderamount != null" >
|
|
|
+ sl_orderamount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_discount != null" >
|
|
|
+ sl_discount,
|
|
|
+ </if>
|
|
|
+ <if test="sl_ym != null" >
|
|
|
+ sl_ym,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="sl_code != null" >
|
|
|
+ #{sl_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sl_kind != null" >
|
|
|
+ #{sl_kind,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sl_custid != null" >
|
|
|
+ #{sl_custid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sl_vendid != null" >
|
|
|
+ #{sl_vendid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sl_date != null" >
|
|
|
+ #{sl_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="sl_amount != null" >
|
|
|
+ #{sl_amount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_preamount != null" >
|
|
|
+ #{sl_preamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_yamount != null" >
|
|
|
+ #{sl_yamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_namount != null" >
|
|
|
+ #{sl_namount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_remark != null" >
|
|
|
+ #{sl_remark,jdbcType=VARCHAR},
|
|
|
+ </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="sl_orderamount != null" >
|
|
|
+ #{sl_orderamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_discount != null" >
|
|
|
+ #{sl_discount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_ym != null" >
|
|
|
+ #{sl_ym,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
|
|
|
+ update subledger
|
|
|
+ <set >
|
|
|
+ <if test="sl_code != null" >
|
|
|
+ sl_code = #{sl_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sl_kind != null" >
|
|
|
+ sl_kind = #{sl_kind,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sl_custid != null" >
|
|
|
+ sl_custid = #{sl_custid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sl_vendid != null" >
|
|
|
+ sl_vendid = #{sl_vendid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sl_date != null" >
|
|
|
+ sl_date = #{sl_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="sl_amount != null" >
|
|
|
+ sl_amount = #{sl_amount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_preamount != null" >
|
|
|
+ sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_yamount != null" >
|
|
|
+ sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_namount != null" >
|
|
|
+ sl_namount = #{sl_namount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_remark != null" >
|
|
|
+ sl_remark = #{sl_remark,jdbcType=VARCHAR},
|
|
|
+ </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="sl_orderamount != null" >
|
|
|
+ sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_discount != null" >
|
|
|
+ sl_discount = #{sl_discount,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="sl_ym != null" >
|
|
|
+ sl_ym = #{sl_ym,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where sl_id = #{sl_id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Subledger" >
|
|
|
+ update subledger
|
|
|
+ set sl_code = #{sl_code,jdbcType=VARCHAR},
|
|
|
+ sl_kind = #{sl_kind,jdbcType=VARCHAR},
|
|
|
+ sl_custid = #{sl_custid,jdbcType=INTEGER},
|
|
|
+ sl_vendid = #{sl_vendid,jdbcType=INTEGER},
|
|
|
+ sl_date = #{sl_date,jdbcType=TIMESTAMP},
|
|
|
+ sl_amount = #{sl_amount,jdbcType=DOUBLE},
|
|
|
+ sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
|
|
|
+ sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
|
|
|
+ sl_namount = #{sl_namount,jdbcType=DOUBLE},
|
|
|
+ sl_remark = #{sl_remark,jdbcType=VARCHAR},
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
|
|
|
+ sl_discount = #{sl_discount,jdbcType=DOUBLE},
|
|
|
+ sl_ym = #{sl_ym,jdbcType=INTEGER}
|
|
|
+ where sl_id = #{sl_id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectSubledgerBycondition" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from subledger
|
|
|
+ <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ and subledger.companyId = #{companyId}
|
|
|
+ </if>
|
|
|
+ </where> order by sl_id
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|