Parcourir la source

增加在库时间

YL2767 il y a 3 jours
Parent
révision
8032bae072

+ 9
- 0
src/main/java/com/th/demo/model/ware/Store.java Voir le fichier

@@ -75,6 +75,15 @@ public class Store  implements Comparable<Store>{
75 75
 
76 76
     private Double invoicePrice;
77 77
     private String contractNo;
78
+    private String inwareDay;
79
+
80
+    public String getInwareDay() {
81
+        return inwareDay;
82
+    }
83
+
84
+    public void setInwareDay(String inwareDay) {
85
+        this.inwareDay = inwareDay;
86
+    }
78 87
 
79 88
     public String getContractNo() {
80 89
         return contractNo;

+ 3
- 2
src/main/resource/mapper/ware/StoreMapper.xml Voir le fichier

@@ -33,6 +33,7 @@
33 33
 
34 34
     <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
35 35
     <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
36
+    <result column="inware_day" property="inwareDay" jdbcType="VARCHAR" />
36 37
 
37 38
 
38 39
     <association  column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
@@ -427,7 +428,7 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
427 428
 
428 429
 
429 430
   <select id="selectStore" resultMap="BaseResultMap" >
430
-    select e.name as fk_compony_id,t.*
431
+    select e.name as fk_compony_id,DATEDIFF(now(), t.add_time) + IF(TIME(now()) > TIME(t.add_time), 1, 0) as inware_day,t.*
431 432
     from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d,t_maint_customer e
432 433
     where t.ware_id = a.id
433 434
     and t.stack_id = b.id
@@ -496,7 +497,7 @@ update t_ware_store t set t.layer =   #{param7,jdbcType=INTEGER}
496 497
 
497 498
 
498 499
   <select id="selectForCustomer" resultMap="BaseResultMap" >
499
-    select e.name as fk_compony_id,t.*
500
+    select e.name as fk_compony_id,t.*,DATEDIFF(now(), t.add_time) + IF(TIME(now()) > TIME(t.add_time), 1, 0) as inware_day
500 501
     from t_ware_store t left join t_maint_customer e
501 502
 		on t.fk_compony_id = e.id
502 503
 		, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d

Loading…
Annuler
Enregistrer