|
@@ -16,14 +16,19 @@
|
16
|
16
|
<result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
|
17
|
17
|
<result column="belong_id" property="belongId" jdbcType="VARCHAR" />
|
18
|
18
|
|
|
19
|
+ <result column="keep_day" property="keepDay" jdbcType="INTEGER" />
|
|
20
|
+ <result column="ord_price" property="ordPrice" jdbcType="DOUBLE" />
|
|
21
|
+ <result column="out_ord_price" property="outOrdPrice" jdbcType="DOUBLE" />
|
|
22
|
+
|
19
|
23
|
<association column="material_id" property="material" select="com.th.demo.mapping.maint.MaterialMapper.selectByPrimaryKey" />
|
20
|
24
|
<association column="add_id" property="addUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
|
21
|
25
|
<association column="modify_id" property="modifyUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
|
|
26
|
+ <association column="customer_id" property="customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
|
22
|
27
|
|
23
|
28
|
</resultMap>
|
24
|
29
|
<sql id="Base_Column_List" >
|
25
|
30
|
id, material_id, storage_price,transfer_price, weight_price, add_id, add_time,
|
26
|
|
- modify_id, modify_time, cancel_id, cancel_time, cancel_flag, belong_id,storage_type
|
|
31
|
+ modify_id, modify_time, cancel_id, cancel_time, cancel_flag, belong_id,storage_type,customer_id,keep_day,ord_price,out_ord_price
|
27
|
32
|
</sql>
|
28
|
33
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
29
|
34
|
select
|
|
@@ -45,12 +50,14 @@
|
45
|
50
|
transfer_price, weight_price, add_id,
|
46
|
51
|
add_time, modify_id, modify_time,
|
47
|
52
|
cancel_id, cancel_time, cancel_flag,
|
48
|
|
- belong_id,storage_type)
|
|
53
|
+ belong_id,storage_type,customer_id,
|
|
54
|
+ keep_day,ord_price,out_ord_price)
|
49
|
55
|
values (#{id,jdbcType=VARCHAR}, #{material.id,jdbcType=VARCHAR}, #{storagePrice,jdbcType=DOUBLE},
|
50
|
56
|
#{transferPrice,jdbcType=DOUBLE}, #{weightPrice,jdbcType=DOUBLE}, #{addUser.id,jdbcType=VARCHAR},
|
51
|
57
|
#{addTime,jdbcType=TIMESTAMP}, #{modifyUser.id,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
|
52
|
58
|
#{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR},
|
53
|
|
- #{belongId,jdbcType=VARCHAR},#{storageType,jdbcType=VARCHAR})
|
|
59
|
+ #{belongId,jdbcType=VARCHAR},#{storageType,jdbcType=VARCHAR},#{customer.id,jdbcType=VARCHAR},
|
|
60
|
+ #{keepDay,jdbcType=INTEGER},#{ordPrice,jdbcType=DOUBLE},#{outOrdPrice,jdbcType=DOUBLE} )
|
54
|
61
|
</insert>
|
55
|
62
|
<insert id="insertSelective" parameterType="com.th.demo.model.maint.Price" >
|
56
|
63
|
insert into t_maint_price
|
|
@@ -193,33 +200,37 @@ transfer_price,
|
193
|
200
|
cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
|
194
|
201
|
cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
|
195
|
202
|
belong_id = #{belongId,jdbcType=VARCHAR},
|
196
|
|
- storage_type = #{storageType,jdbcType=VARCHAR}
|
|
203
|
+ storage_type = #{storageType,jdbcType=VARCHAR},
|
|
204
|
+ customer_id = #{customer.id,jdbcType=VARCHAR},
|
|
205
|
+ keep_day = #{keepDay,jdbcType=INTEGER},
|
|
206
|
+ ord_price = #{ordPrice,jdbcType=VARCHAR},
|
|
207
|
+ out_ord_price = #{outOrdPrice,jdbcType=VARCHAR}
|
197
|
208
|
where id = #{id,jdbcType=VARCHAR}
|
198
|
209
|
</update>
|
199
|
210
|
|
200
|
211
|
<select id="selectByMaterialChangeTime" resultMap="BaseResultMap" >
|
201
|
212
|
select * from t_maint_price
|
202
|
|
- where material_id = #{param1,jdbcType=VARCHAR}
|
203
|
|
- and storage_type = #{param2,jdbcType=VARCHAR}
|
204
|
|
- and belong_id = #{param3,jdbcType=VARCHAR}
|
|
213
|
+ where 1=1 --material_id = #{param1,jdbcType=VARCHAR}
|
|
214
|
+ --and storage_type = #{param2,jdbcType=VARCHAR}
|
|
215
|
+ and customer_id = #{param1,jdbcType=VARCHAR}
|
|
216
|
+ and belong_id = #{param2,jdbcType=VARCHAR}
|
205
|
217
|
and cancel_flag = '0'
|
206
|
218
|
</select>
|
207
|
219
|
|
208
|
220
|
|
209
|
221
|
<select id="select" resultMap="BaseResultMap" >
|
210
|
|
- select t.* from t_maint_price t ,t_maint_material d
|
211
|
|
- where t.material_id = d.id
|
212
|
|
- and d.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
|
213
|
|
- and d.standard like concat('%',#{param2,jdbcType=VARCHAR},'%')
|
214
|
|
- and t.belong_id=#{param3,jdbcType=VARCHAR}
|
|
222
|
+ select t.* from t_maint_price t ,t_maint_customer d
|
|
223
|
+ where t.customer_id = d.id
|
|
224
|
+ and d.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
|
|
225
|
+ and t.belong_id = #{param2,jdbcType=VARCHAR}
|
215
|
226
|
and t.cancel_flag = '0'
|
216
|
227
|
</select>
|
217
|
228
|
|
218
|
229
|
|
219
|
230
|
<select id="selectCntByMaterialChangeTime" resultType="java.lang.Integer" >
|
220
|
231
|
select count(*) from t_maint_price
|
221
|
|
- where material_id = #{param1,jdbcType=VARCHAR}
|
222
|
|
- and storage_type = #{param2,jdbcType=VARCHAR}
|
|
232
|
+ where 1=1
|
|
233
|
+ and customer_id = #{param1,jdbcType=VARCHAR}
|
223
|
234
|
and belong_id = #{param3,jdbcType=VARCHAR}
|
224
|
235
|
and cancel_flag = '0'
|
225
|
236
|
</select>
|