You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
backend-duoji-monitor/web/target/classes/mapper/StockMapper.xml

21 lines
924 B
XML

4 years ago
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.zhehekeji.web.mapper.StockMapper">
<insert id="batchInsert" parameterType="java.util.List">
insert into stock(
category,count,shelve_id,row,column,status,export_time
) values
<foreach collection="stocks" item="item" separator=",">
(#{item.category},#{item.count},#{item.shelveId},#{item.row},#{item.column},#{item.status},#{item.exportTime})
</foreach>
</insert>
<insert id="insertOrUpdate">
insert into stock(
category,`count`,shelve_id,row,`column`,status
) values (#{req.category},#{req.count},#{req.shelveId},#{req.row},#{req.column},#{req.status})
ON DUPLICATE KEY UPDATE set `count` = #{req.count},category = #{req.category}
</insert>
</mapper>