insert into business_resource_store(
res_name,operate,price,res_code,description,store_id,stock,warning_stock,b_id,res_id,
unit_code,remark,out_low_price,out_high_price,show_mobile,create_time,sh_id,average_price,rst_id,rss_id,
mini_unit_code,mini_unit_stock,mini_stock
) values (
#{resName},#{operate},#{price},#{resCode},#{description},#{storeId},#{stock},#{warningStock},#{bId},#{resId},
#{unitCode},#{remark},#{outLowPrice},#{outHighPrice},#{showMobile},#{createTime},#{shId},
#{averagePrice},#{rstId},#{rssId},#{miniUnitCode},#{miniUnitStock},#{miniStock}
)
insert into resource_store(
res_id,b_id,store_id,res_name,res_code,unit_code,remark,out_low_price,out_high_price,show_mobile,description,
price,stock,create_time,sh_id,warning_stock,average_price,rss_id,rst_id,mini_unit_code,mini_unit_stock,mini_stock
) values (
#{resId},#{bId},#{storeId},#{resName},#{resCode},#{unitCode},#{remark},#{outLowPrice},#{outHighPrice},
#{showMobile},#{description},#{price},#{stock},#{createTime},#{shId},#{warningStock},
#{averagePrice},#{rssId},#{rstId},#{miniUnitCode},#{miniUnitStock},#{miniStock}
)
insert into resource_store(
res_name,price,res_code,description,status_cd,store_id,stock,warning_stock,b_id,res_id,unit_code,remark,
out_low_price,out_high_price,show_mobile,create_time,sh_id,average_price,rst_id,rss_id,mini_unit_code,mini_unit_stock,
mini_stock
) select
t.res_name,t.price,t.res_code,t.description,'0',t.store_id,t.stock,t.warning_stock,t.b_id,t.res_id,
t.unit_code,t.remark,t.out_low_price,t.out_high_price,t.show_mobile,t.create_time,t.sh_id,t.average_price,t.rst_id,t.rss_id,
t.mini_unit_code,t.mini_unit_stock,t.mini_stock
from business_resource_store t where 1=1
and t.res_name= #{resName}
and t.operate= 'ADD'
and t.price= #{price}
and t.res_code= #{resCode}
and t.rst_id= #{rstId}
and t.rss_id= #{rssId}
and t.description= #{description}
and t.store_id= #{storeId}
and t.stock= #{stock}
and t.warning_stock= #{warningStock}
and t.b_id= #{bId}
and t.res_id= #{resId}
and t.unit_code= #{unitCode}
and t.remark= #{remark}
and t.out_low_price= #{outLowPrice}
and t.out_high_price= #{outHighPrice}
and t.show_mobile= #{showMobile}
and t.average_price= #{averagePrice}
and t.mini_unit_code= #{miniUnitCode}
and t.mini_unit_stock= #{miniUnitStock}
and t.mini_stock= #{miniStock}
and t.create_time= #{createTime}
update resource_store t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.res_name= #{resName}
, t.price= #{price}
, t.rst_id= #{rstId}
, t.rss_id= #{rssId}
, t.out_low_price= #{outLowPrice}
, t.out_high_price= #{outHighPrice}
, t.unit_code= #{unitCode}
, t.show_mobile= #{showMobile}
, t.remark= #{remark}
, t.res_code= #{resCode}
, t.description= #{description}
, t.store_id= #{storeId}
, t.stock= #{stock}
, t.warning_stock= #{warningStock}
, t.sh_id= #{shId}
, t.average_price= #{averagePrice}
, t.mini_unit_code= #{miniUnitCode}
, t.mini_unit_stock= #{miniUnitStock}
, t.mini_stock= #{miniStock}
where 1=1
and t.b_id= #{bId}
and t.res_id= #{resId}