Inventory(盘库指令)中有仓库列表属性List
向数据库中保存盘库指令对应的仓库列表关系时,映射文件内容如下,其中该方法接收的参数为Inventory实体类
INSERT INTO qk_yw_pk_stock(pkcode,stockid,stockcode,stockname,rwjxscode,bsccode)
SELECT
#{invCode},
#{stock.id},
#{stock.stockCode},
#{stock.stockName},
#{stock.rwjxsCode},
#{stock.bscCode}
FROM dual
应用背景为:接口接收List
直接贴上映射文件的方法的代码,该方法接收的参数为List
url: jdbc:mysql://10.2.29.146:3306/ms_inventory?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true)
UPDATE qk_yw_pk_trucks SET
truckid = #{truck.truckid},
clzt = #{truck.clzt},
xsdid = #{truck.xsdid},
xsdh = #{truck.xsdh},
xszt = #{truck.xszt},
cxh = #{truck.cxh},
ywms = #{truck.ywms},
stockid = #{truck.stockid},
stockcode = #{truck.stockcode},
stockname = #{truck.stockname},
bscid = #{truck.bscid},
bsccode = #{truck.bsccode},
bscname = #{truck.bscname},
rwjxsid = #{truck.rwjxsid},
rwjxscode = #{truck.rwjxscode},
rwjxsjc = #{truck.rwjxsjc},
truck_create_date = null,
truck_create_date = #{truck.truck_create_date},
truck_jnck_date = null,
truck_jnck_date = #{truck.truck_jnck_date},
truck_zsck_date = null,
truck_zsck_date = #{truck.truck_zsck_date},
truck_md_date = null,
truck_md_date = #{truck.truck_md_date},
truck_sx_date = null,
truck_sx_date = #{truck.truck_sx_date},
del_flag = #{truck.del_flag},
remarks = remarks
WHERE cjh = #{truck.cjh}