Zhangqy 2 kuukautta sitten
vanhempi
commit
bb691903d2

+ 17
- 0
src/main/java/com/th/demo/mapping/ware/CargoChangeRecordMapper.java Näytä tiedosto

@@ -0,0 +1,17 @@
1
+package com.th.demo.mapping.ware;
2
+
3
+import com.th.demo.model.ware.CargoChangeRecord;
4
+
5
+public interface CargoChangeRecordMapper {
6
+
7
+    CargoChangeRecord selectByPrimaryKey(String id);
8
+
9
+    int deleteByPrimaryKey(String id);
10
+
11
+    int insert(CargoChangeRecord record);
12
+
13
+    CargoChangeRecord selectByCustomer(String uperCustomer, String Customer);
14
+
15
+
16
+
17
+}

+ 9
- 0
src/main/java/com/th/demo/model/maint/Cargo.java Näytä tiedosto

@@ -6,6 +6,7 @@ public class Cargo {
6 6
     private Customer uperCustomer;
7 7
     private Customer Customer;
8 8
     private double sumWeight;
9
+    private double useWeight;
9 10
     private String belongId;
10 11
 
11 12
     public String getId() {
@@ -47,4 +48,12 @@ public class Cargo {
47 48
     public void setBelongId(String belongId) {
48 49
         this.belongId = belongId;
49 50
     }
51
+
52
+    public double getUseWeight() {
53
+        return useWeight;
54
+    }
55
+
56
+    public void setUseWeight(double useWeight) {
57
+        this.useWeight = useWeight;
58
+    }
50 59
 }

+ 87
- 0
src/main/java/com/th/demo/model/ware/CargoChangeRecord.java Näytä tiedosto

@@ -0,0 +1,87 @@
1
+package com.th.demo.model.ware;
2
+
3
+import com.th.demo.model.maint.Customer;
4
+import com.th.demo.model.system.SysUser;
5
+
6
+import java.util.Date;
7
+
8
+public class CargoChangeRecord {
9
+    private String id; // 主键
10
+
11
+    private SysUser modifyUser; // 修改人员
12
+
13
+    private Date modifyTime; //修改时间
14
+
15
+    private Double weight; // 修改重量
16
+
17
+    private String changeFrom;  //修改的源头 1、手动调整 2、货权转移 3、取消货权转移
18
+
19
+    private String subStr;  //变动情况 1、增加 2、减少
20
+
21
+    private com.th.demo.model.maint.Customer uperCustomer;
22
+    private Customer Customer;
23
+
24
+    public String getId() {
25
+        return id;
26
+    }
27
+
28
+    public void setId(String id) {
29
+        this.id = id;
30
+    }
31
+
32
+    public SysUser getModifyUser() {
33
+        return modifyUser;
34
+    }
35
+
36
+    public void setModifyUser(SysUser modifyUser) {
37
+        this.modifyUser = modifyUser;
38
+    }
39
+
40
+    public Date getModifyTime() {
41
+        return modifyTime;
42
+    }
43
+
44
+    public void setModifyTime(Date modifyTime) {
45
+        this.modifyTime = modifyTime;
46
+    }
47
+
48
+    public Double getWeight() {
49
+        return weight;
50
+    }
51
+
52
+    public void setWeight(Double weight) {
53
+        this.weight = weight;
54
+    }
55
+
56
+    public String getChangeFrom() {
57
+        return changeFrom;
58
+    }
59
+
60
+    public void setChangeFrom(String changeFrom) {
61
+        this.changeFrom = changeFrom;
62
+    }
63
+
64
+    public String getSubStr() {
65
+        return subStr;
66
+    }
67
+
68
+    public void setSubStr(String subStr) {
69
+        this.subStr = subStr;
70
+    }
71
+
72
+    public com.th.demo.model.maint.Customer getUperCustomer() {
73
+        return uperCustomer;
74
+    }
75
+
76
+    public void setUperCustomer(com.th.demo.model.maint.Customer uperCustomer) {
77
+        this.uperCustomer = uperCustomer;
78
+    }
79
+
80
+    public com.th.demo.model.maint.Customer getCustomer() {
81
+        return Customer;
82
+    }
83
+
84
+    public void setCustomer(com.th.demo.model.maint.Customer customer) {
85
+        Customer = customer;
86
+    }
87
+}

+ 7
- 7
src/main/resource/localhost/db.properties Näytä tiedosto

@@ -1,14 +1,14 @@
1
-#jdbc.driverClass=com.mysql.jdbc.Driver
2
-#jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_mj?useUnicode=true&characterEncoding=utf8
3
-#jdbc.user=root
4
-#jdbc.password=root
5
-
6
-#???????????????????????????????
7 1
 jdbc.driverClass=com.mysql.jdbc.Driver
8
-jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_mj?characterEncoding=utf8
2
+jdbc.jdbcUrl=jdbc:mysql://172.18.200.32:3306/ware_mj?useUnicode=true&characterEncoding=utf8
9 3
 jdbc.user=root
10 4
 jdbc.password=root
11 5
 
6
+#???????????????????????????????
7
+#jdbc.driverClass=com.mysql.jdbc.Driver
8
+#jdbc.jdbcUrl=jdbc:mysql://localhost:3306/ware_mj?characterEncoding=utf8
9
+#jdbc.user=root
10
+#jdbc.password=root
11
+
12 12
 #jdbc.driverClass=com.mysql.jdbc.Driver
13 13
 #jdbc.jdbcUrl=jdbc:mysql://60.205.9.174:3309/thware?useUnicode=true&characterEncoding=utf8
14 14
 #jdbc.user=root

+ 3
- 1
src/main/resource/mapper/maint/CargoMapper.xml Näytä tiedosto

@@ -4,6 +4,7 @@
4 4
     <resultMap id="BaseResultMap" type="com.th.demo.model.maint.Cargo" >
5 5
         <id column="id" property="id" jdbcType="VARCHAR" />
6 6
         <result column="sum_weight" property="sumWeight" jdbcType="DOUBLE" />
7
+        <result column="use_weight" property="useWeight" jdbcType="DOUBLE" />
7 8
         <result column="belong_id" property="belongId" jdbcType="DOUBLE" />
8 9
 
9 10
         <association  column="uper_customer_id" property="uperCustomer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
@@ -11,7 +12,7 @@
11 12
     </resultMap>
12 13
 
13 14
     <sql id="Base_Column_List" >
14
-        id, uper_customer_id, customer_id, sum_weight, belong_id
15
+        id, uper_customer_id, customer_id, sum_weight,use_weight,belong_id
15 16
     </sql>
16 17
 
17 18
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
@@ -26,6 +27,7 @@
26 27
         set uper_customer_id = #{uperCustomer.id ,jdbcType=VARCHAR},
27 28
             customer_id = #{Customer.id ,jdbcType=VARCHAR},
28 29
             sum_weight = #{sumWeight,jdbcType=DOUBLE},
30
+            use_weight = #{useWeight,jdbcType=DOUBLE},
29 31
             belong_id = #{belongId,jdbcType=VARCHAR}
30 32
         where id = #{id,jdbcType=VARCHAR}
31 33
     </update>

+ 55
- 0
src/main/resource/mapper/ware/CargoChangeRecordMapper.xml Näytä tiedosto

@@ -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>

Loading…
Peruuta
Tallenna