|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
2
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
3
|
+<mapper namespace="com.th.demo.mapping.ware.CargoChangeRecordMapper" >
|
|
|
4
|
+ <resultMap id="BaseResultMap" type="com.th.demo.model.ware.CargoChangeRecord" >
|
|
|
5
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
6
|
+ <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
|
|
|
7
|
+ <result column="weight" property="weight" jdbcType="DOUBLE" />
|
|
|
8
|
+ <result column="change_from" property="changeFrom" javaType="VARCHAR"/>
|
|
|
9
|
+ <result column="sub_str" property="subStr" javaType="VARCHAR"/>
|
|
|
10
|
+
|
|
|
11
|
+ <association column="modify_id" property="modifyUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
|
|
|
12
|
+ <association column="uper_customer_id" property="uperCustomer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
|
|
|
13
|
+ <association column="customer_id" property="Customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
|
|
|
14
|
+ </resultMap>
|
|
|
15
|
+
|
|
|
16
|
+ <sql id="Base_Column_List" >
|
|
|
17
|
+ id, modify_id, modify_time, weight, change_from, sub_str, uper_customer_id, customer_id
|
|
|
18
|
+ </sql>
|
|
|
19
|
+
|
|
|
20
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
21
|
+ select
|
|
|
22
|
+ <include refid="Base_Column_List" />
|
|
|
23
|
+ from t_ware_cargochange_record
|
|
|
24
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
25
|
+ </select>
|
|
|
26
|
+
|
|
|
27
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
28
|
+ delete from t_ware_cargochange_record
|
|
|
29
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
30
|
+ </delete>
|
|
|
31
|
+
|
|
|
32
|
+ <insert id="insert" parameterType="com.th.demo.model.ware.CargoChangeRecord" >
|
|
|
33
|
+
|
|
|
34
|
+ <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
|
|
|
35
|
+ SELECT REPLACE(UUID(),'-','') as id from dual
|
|
|
36
|
+ </selectKey>
|
|
|
37
|
+
|
|
|
38
|
+ insert into t_ware_cargochange_record (id, modify_id, modify_time,
|
|
|
39
|
+ weight, change_from, sub_str,
|
|
|
40
|
+ uper_customer_id, customer_id )
|
|
|
41
|
+ values (#{id,jdbcType=VARCHAR},#{modifyUser.id,jdbcType=VARCHAR},#{modifyTime,jdbcType=TIMESTAMP},
|
|
|
42
|
+ #{weight,jdbcType=DOUBLE},#{changeFrom,jdbcType=VARCHAR},#{subStr,jdbcType=VARCHAR},
|
|
|
43
|
+ #{uperCustomer.id,jdbcType=VARCHAR}, #{Customer.id,jdbcType=VARCHAR})
|
|
|
44
|
+ </insert>
|
|
|
45
|
+
|
|
|
46
|
+ <select id="selectByCustomer" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
47
|
+ select
|
|
|
48
|
+ <include refid="Base_Column_List" />
|
|
|
49
|
+ from t_ware_cargochange_record
|
|
|
50
|
+ where uper_customer_id = #{param1,jdbcType=VARCHAR}
|
|
|
51
|
+ and customer_id = #{param2,jdbcType=VARCHAR}
|
|
|
52
|
+ </select>
|
|
|
53
|
+
|
|
|
54
|
+
|
|
|
55
|
+</mapper>
|