|
|
@@ -0,0 +1,44 @@
|
|
|
+<?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.purchase.mapper.PurchaseItemMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.PurchaseItem">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="company_id" jdbcType="BIGINT" property="companyId"/>
|
|
|
+ <result column="main_id" jdbcType="BIGINT" property="mainId"/>
|
|
|
+ <result column="order_num" jdbcType="INT" property="orderNum"/>
|
|
|
+ <result column="product_id" jdbcType="BIGINT" property="productId"/>
|
|
|
+ <result column="warehouse_id" jdbcType="BIGINT" property="warehouseId"/>
|
|
|
+ <result column="qty" jdbcType="DOUBLE" property="qty"/>
|
|
|
+ <result column="price" jdbcType="DOUBLE" property="price"/>
|
|
|
+ <result column="tax_price" jdbcType="DOUBLE" property="taxPrice"/>
|
|
|
+ <result column="tax_rate" jdbcType="FLOAT" property="taxRate"/>
|
|
|
+ <result column="tax_amount" jdbcType="DOUBLE" property="taxAmount"/>
|
|
|
+ <result column="dis_rate" jdbcType="FLOAT" property="disRate"/>
|
|
|
+ <result column="dis_amount" jdbcType="DOUBLE" property="disAmount"/>
|
|
|
+ <result column="amount" jdbcType="DOUBLE" property="amount"/>
|
|
|
+ <result column="total_tax_amount" jdbcType="DOUBLE" property="totalTaxAmount"/>
|
|
|
+ <result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
|
+ <result column="src_order_id" jdbcType="BIGINT" property="srcOrderId"/>
|
|
|
+ <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="baseColumns">
|
|
|
+ id,company_id,main_id,order_num,product_id,warehouse_id,qty,price,tax_price,tax_rate,tax_amount,dis_rate,dis_amount,amount,
|
|
|
+ total_tax_amount,remark,src_order_id,creator_id,create_time,updater_id,update_time
|
|
|
+ </sql>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.purchase.po.PurchaseItem">
|
|
|
+ insert into purchase_item(company_id,main_id,order_num,product_id,warehouse_id,qty,price,tax_price,tax_rate,tax_amount,dis_rate,dis_amount,amount,
|
|
|
+ total_tax_amount,remark,src_order_id,creator_id,create_time,updater_id,update_time)
|
|
|
+ values (#{companyId,jdbcType=BIGINT}, #{mainId,jdbcType=BIGINT}, #{orderNum,jdbcType=INT}, #{productId,jdbcType=BIGINT},
|
|
|
+ #{warehouseId,jdbcType=BIGINT}, #{qty,jdbcType=DOUBLE}, #{price,jdbcType=DOUBLE},
|
|
|
+ #{tax_price,jdbcType=DOUBLE}, #{tax_rate,jdbcType=FLOAT}, #{tax_amount,jdbcType=DOUBLE},
|
|
|
+ #{dis_rate,jdbcType=FLOAT}, #{dis_amount,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE},
|
|
|
+ #{total_tax_amount,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{src_order_id,jdbcType=BIGINT}
|
|
|
+ #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <select id="selectByMainId" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select <include refid="baseColumns"/> from purchase_item where main_id=#{mainId}
|
|
|
+ </select>
|
|
|
+</mapper>
|