| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <?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.SubledgerMapper" >
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.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.String" >
- delete from subledger
- where sl_code = #{code,jdbcType=VARCHAR} and sl_kind = #{kind, jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.usoftchina.saas.document.entities.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,
- creatorId,createTime,creatorName)
- 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},
- #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.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>
- <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="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>
- <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>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.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 = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.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_date desc
- </select>
- <select id="selectCode" parameterType="java.lang.String" resultMap="BaseResultMap">
- select sl_code
- from subledger
- where sl_code = #{sl_code,jdbcType=VARCHAR}
- </select>
- <select id="selectByKindCodeCustid" resultType="java.lang.Long">
- select
- ifnull(sl_id,0)
- from subledger
- where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind,jdbcType=VARCHAR} and
- sl_custid = #{sl_custid,jdbcType=INTEGER} and companyId = #{companyid,jdbcType=INTEGER}
- and sl_ym=#{sl_ym,jdbcType=VARCHAR}
- </select>
- <select id="selectByKindCodeVendid" resultType="java.lang.Long">
- select
- ifnull(sl_id,0)
- from subledger
- where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind,jdbcType=VARCHAR} and
- sl_vendid = #{sl_vendid,jdbcType=INTEGER} and companyId = #{companyid,jdbcType=INTEGER}
- and sl_ym=#{sl_ym,jdbcType=VARCHAR}
- </select>
- <delete id="deleteCustomer">
- delete from subledger
- where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind, jdbcType=VARCHAR} and
- sl_custid = #{sl_custid,jdbcType=INTEGER}
- </delete>
- <delete id="deleteVendor">
- delete from subledger
- where sl_code = #{sl_code,jdbcType=VARCHAR} and sl_kind = #{sl_kind, jdbcType=VARCHAR} and
- sl_vendid = #{sl_vendid,jdbcType=INTEGER}
- </delete>
- <select id="selectUnPeriod" resultType="string">
- select PD_DETNO from periodsdetail where companyid=#{companyId} and pd_status=99 order by PD_DETNO desc LIMIT 1;
- </select>
- </mapper>
|