|
|
@@ -0,0 +1,370 @@
|
|
|
+<?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.storage.mapper.MakeMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.Make" >
|
|
|
+ <id column="ma_id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="ma_code" property="ma_code" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_status" property="ma_status" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_statuscode" property="ma_statuscode" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_type" property="ma_type" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_prodid" property="ma_prodid" jdbcType="INTEGER" />
|
|
|
+ <result column="ma_prodcode" property="ma_prodcode" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_proddetail" property="ma_proddetail" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_prodspec" property="ma_prodspec" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_version" property="ma_version" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_produnit" property="ma_produnit" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_qty" property="ma_qty" jdbcType="DOUBLE" />
|
|
|
+ <result column="ma_whid" property="ma_whid" jdbcType="INTEGER" />
|
|
|
+ <result column="ma_whcode" property="ma_whcode" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_recorddate" property="ma_recorddate" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="ma_recordid" property="ma_recordid" jdbcType="INTEGER" />
|
|
|
+ <result column="ma_recorder" property="ma_recorder" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_price" property="ma_price" jdbcType="DOUBLE" />
|
|
|
+ <result column="ma_total" property="ma_total" jdbcType="DOUBLE" />
|
|
|
+ <result column="companyId" property="companyId" jdbcType="INTEGER" />
|
|
|
+ <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
|
|
|
+ <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="ma_text1" property="ma_text1" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_text2" property="ma_text2" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_text3" property="ma_text3" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_text4" property="ma_text4" jdbcType="VARCHAR" />
|
|
|
+ <result column="ma_text5" property="ma_text5" jdbcType="VARCHAR" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail,
|
|
|
+ ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_recorddate,
|
|
|
+ ma_recordid, ma_recorder, ma_price, ma_total, companyId, updaterId, updateTime, ma_text1,
|
|
|
+ ma_text2, ma_text3, ma_text4, ma_text5
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from make
|
|
|
+ where ma_id = #{id}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ delete from make
|
|
|
+ where ma_id = #{id}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.storage.po.Make" >
|
|
|
+ <selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
+ SELECT LAST_INSERT_ID() AS ID
|
|
|
+ </selectKey>
|
|
|
+ insert into make (ma_code, ma_status,
|
|
|
+ ma_statuscode, ma_type, ma_prodid,
|
|
|
+ ma_prodcode, ma_proddetail, ma_prodspec,
|
|
|
+ ma_version, ma_produnit, ma_qty,
|
|
|
+ ma_whid, ma_whcode, ma_recorddate,
|
|
|
+ ma_recordid, ma_recorder, ma_price,
|
|
|
+ ma_total, companyId, updaterId,
|
|
|
+ updateTime, ma_text1, ma_text2,
|
|
|
+ ma_text3, ma_text4, ma_text5
|
|
|
+ )
|
|
|
+ values (#{ma_code,jdbcType=VARCHAR}, #{ma_status,jdbcType=VARCHAR},
|
|
|
+ #{ma_statuscode,jdbcType=VARCHAR}, #{ma_type,jdbcType=VARCHAR}, #{ma_prodid,jdbcType=INTEGER},
|
|
|
+ #{ma_prodcode,jdbcType=VARCHAR}, #{ma_proddetail,jdbcType=VARCHAR}, #{ma_prodspec,jdbcType=VARCHAR},
|
|
|
+ #{ma_version,jdbcType=VARCHAR}, #{ma_produnit,jdbcType=VARCHAR}, #{ma_qty,jdbcType=DOUBLE},
|
|
|
+ #{ma_whid,jdbcType=INTEGER}, #{ma_whcode,jdbcType=VARCHAR}, #{ma_recorddate,jdbcType=TIMESTAMP},
|
|
|
+ #{ma_recordid,jdbcType=INTEGER}, #{ma_recorder,jdbcType=VARCHAR}, #{ma_price,jdbcType=DOUBLE},
|
|
|
+ #{ma_total,jdbcType=DOUBLE}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP}, #{ma_text1,jdbcType=VARCHAR}, #{ma_text2,jdbcType=VARCHAR},
|
|
|
+ #{ma_text3,jdbcType=VARCHAR}, #{ma_text4,jdbcType=VARCHAR}, #{ma_text5,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.Make" >
|
|
|
+ <selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
+ SELECT LAST_INSERT_ID() AS ID
|
|
|
+ </selectKey>
|
|
|
+ insert into make
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="ma_code != null" >
|
|
|
+ ma_code,
|
|
|
+ </if>
|
|
|
+ <if test="ma_status != null" >
|
|
|
+ ma_status,
|
|
|
+ </if>
|
|
|
+ <if test="ma_statuscode != null" >
|
|
|
+ ma_statuscode,
|
|
|
+ </if>
|
|
|
+ <if test="ma_type != null" >
|
|
|
+ ma_type,
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodid != null" >
|
|
|
+ ma_prodid,
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodcode != null" >
|
|
|
+ ma_prodcode,
|
|
|
+ </if>
|
|
|
+ <if test="ma_proddetail != null" >
|
|
|
+ ma_proddetail,
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodspec != null" >
|
|
|
+ ma_prodspec,
|
|
|
+ </if>
|
|
|
+ <if test="ma_version != null" >
|
|
|
+ ma_version,
|
|
|
+ </if>
|
|
|
+ <if test="ma_produnit != null" >
|
|
|
+ ma_produnit,
|
|
|
+ </if>
|
|
|
+ <if test="ma_qty != null" >
|
|
|
+ ma_qty,
|
|
|
+ </if>
|
|
|
+ <if test="ma_whid != null" >
|
|
|
+ ma_whid,
|
|
|
+ </if>
|
|
|
+ <if test="ma_whcode != null" >
|
|
|
+ ma_whcode,
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorddate != null" >
|
|
|
+ ma_recorddate,
|
|
|
+ </if>
|
|
|
+ <if test="ma_recordid != null" >
|
|
|
+ ma_recordid,
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorder != null" >
|
|
|
+ ma_recorder,
|
|
|
+ </if>
|
|
|
+ <if test="ma_price != null" >
|
|
|
+ ma_price,
|
|
|
+ </if>
|
|
|
+ <if test="ma_total != null" >
|
|
|
+ ma_total,
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null" >
|
|
|
+ companyId,
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="ma_text1 != null" >
|
|
|
+ ma_text1,
|
|
|
+ </if>
|
|
|
+ <if test="ma_text2 != null" >
|
|
|
+ ma_text2,
|
|
|
+ </if>
|
|
|
+ <if test="ma_text3 != null" >
|
|
|
+ ma_text3,
|
|
|
+ </if>
|
|
|
+ <if test="ma_text4 != null" >
|
|
|
+ ma_text4,
|
|
|
+ </if>
|
|
|
+ <if test="ma_text5 != null" >
|
|
|
+ ma_text5,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="ma_code != null" >
|
|
|
+ #{ma_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_status != null" >
|
|
|
+ #{ma_status,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_statuscode != null" >
|
|
|
+ #{ma_statuscode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_type != null" >
|
|
|
+ #{ma_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodid != null" >
|
|
|
+ #{ma_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodcode != null" >
|
|
|
+ #{ma_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_proddetail != null" >
|
|
|
+ #{ma_proddetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodspec != null" >
|
|
|
+ #{ma_prodspec,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_version != null" >
|
|
|
+ #{ma_version,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_produnit != null" >
|
|
|
+ #{ma_produnit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_qty != null" >
|
|
|
+ #{ma_qty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="ma_whid != null" >
|
|
|
+ #{ma_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_whcode != null" >
|
|
|
+ #{ma_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorddate != null" >
|
|
|
+ #{ma_recorddate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recordid != null" >
|
|
|
+ #{ma_recordid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorder != null" >
|
|
|
+ #{ma_recorder,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_price != null" >
|
|
|
+ #{ma_price,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="ma_total != null" >
|
|
|
+ #{ma_total,jdbcType=DOUBLE},
|
|
|
+ </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="ma_text1 != null" >
|
|
|
+ #{ma_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text2 != null" >
|
|
|
+ #{ma_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text3 != null" >
|
|
|
+ #{ma_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text4 != null" >
|
|
|
+ #{ma_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text5 != null" >
|
|
|
+ #{ma_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.Make" >
|
|
|
+ update make
|
|
|
+ <set >
|
|
|
+ <if test="ma_code != null" >
|
|
|
+ ma_code = #{ma_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_status != null" >
|
|
|
+ ma_status = #{ma_status,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_statuscode != null" >
|
|
|
+ ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_type != null" >
|
|
|
+ ma_type = #{ma_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodid != null" >
|
|
|
+ ma_prodid = #{ma_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodcode != null" >
|
|
|
+ ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_proddetail != null" >
|
|
|
+ ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_prodspec != null" >
|
|
|
+ ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_version != null" >
|
|
|
+ ma_version = #{ma_version,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_produnit != null" >
|
|
|
+ ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_qty != null" >
|
|
|
+ ma_qty = #{ma_qty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="ma_whid != null" >
|
|
|
+ ma_whid = #{ma_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_whcode != null" >
|
|
|
+ ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorddate != null" >
|
|
|
+ ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recordid != null" >
|
|
|
+ ma_recordid = #{ma_recordid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="ma_recorder != null" >
|
|
|
+ ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_price != null" >
|
|
|
+ ma_price = #{ma_price,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="ma_total != null" >
|
|
|
+ ma_total = #{ma_total,jdbcType=DOUBLE},
|
|
|
+ </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="ma_text1 != null" >
|
|
|
+ ma_text1 = #{ma_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text2 != null" >
|
|
|
+ ma_text2 = #{ma_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text3 != null" >
|
|
|
+ ma_text3 = #{ma_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text4 != null" >
|
|
|
+ ma_text4 = #{ma_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="ma_text5 != null" >
|
|
|
+ ma_text5 = #{ma_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ma_id = #{id}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.Make" >
|
|
|
+ update make
|
|
|
+ set ma_code = #{ma_code,jdbcType=VARCHAR},
|
|
|
+ ma_status = #{ma_status,jdbcType=VARCHAR},
|
|
|
+ ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
|
|
|
+ ma_type = #{ma_type,jdbcType=VARCHAR},
|
|
|
+ ma_prodid = #{ma_prodid,jdbcType=INTEGER},
|
|
|
+ ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
|
|
|
+ ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
|
|
|
+ ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
|
|
|
+ ma_version = #{ma_version,jdbcType=VARCHAR},
|
|
|
+ ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
|
|
|
+ ma_qty = #{ma_qty,jdbcType=DOUBLE},
|
|
|
+ ma_whid = #{ma_whid,jdbcType=INTEGER},
|
|
|
+ ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
|
|
|
+ ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
|
|
|
+ ma_recordid = #{ma_recordid,jdbcType=INTEGER},
|
|
|
+ ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
|
|
|
+ ma_price = #{ma_price,jdbcType=DOUBLE},
|
|
|
+ ma_total = #{ma_total,jdbcType=DOUBLE},
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ ma_text1 = #{ma_text1,jdbcType=VARCHAR},
|
|
|
+ ma_text2 = #{ma_text2,jdbcType=VARCHAR},
|
|
|
+ ma_text3 = #{ma_text3,jdbcType=VARCHAR},
|
|
|
+ ma_text4 = #{ma_text4,jdbcType=VARCHAR},
|
|
|
+ ma_text5 = #{ma_text5,jdbcType=VARCHAR}
|
|
|
+ where ma_id = #{id}
|
|
|
+ </update>
|
|
|
+ <select id="getListDataByCondition" resultMap="BaseResultMap">
|
|
|
+ SELECT * FROM MAKE
|
|
|
+ <where>
|
|
|
+ <if test="condition!=null">
|
|
|
+ ${condition}
|
|
|
+ </if>
|
|
|
+ AND MAKE.COMPANYID = #{companyId}
|
|
|
+ </where>
|
|
|
+ order by MA_ID
|
|
|
+ </select>
|
|
|
+ <select id="validateCodeWhenInsert" resultType="int">
|
|
|
+ select count(*) from MAKE where MA_CODE = #{code} and companyId =#{companyId}
|
|
|
+ </select>
|
|
|
+ <select id="validateCodeWhenUpdate" resultType="int" >
|
|
|
+ select count(*) from MAKE where MA_CODE = #{code} and MA_ID != #{id} and companyId =#{companyId}
|
|
|
+ </select>
|
|
|
+</mapper>
|