id, productid, directioncode, directionboxcode, num, owner, status, indate, outdate, operator, type, remark, createdby, createddate, modifiedby, modifieddate, flag insert into stock${slice} id, productid, directioncode, directionboxcode, num, owner, status, indate, outdate, operator, type, remark, createdby, createddate, modifiedby, modifieddate, flag, #{stockInfo.id,jdbcType=BIGINT}, #{stockInfo.productid,jdbcType=BIGINT}, #{stockInfo.directioncode,jdbcType=VARCHAR}, #{stockInfo.directionboxcode,jdbcType=VARCHAR}, #{stockInfo.num,jdbcType=INTEGER}, #{stockInfo.owner,jdbcType=VARCHAR}, #{stockInfo.status,jdbcType=VARCHAR}, #{stockInfo.indate,jdbcType=TIMESTAMP}, #{stockInfo.outdate,jdbcType=TIMESTAMP}, #{stockInfo.operator,jdbcType=VARCHAR}, #{stockInfo.type,jdbcType=TINYINT}, #{stockInfo.remark,jdbcType=VARCHAR}, #{stockInfo.createdby,jdbcType=VARCHAR}, #{stockInfo.createddate,jdbcType=TIMESTAMP}, #{stockInfo.modifiedby,jdbcType=VARCHAR}, #{stockInfo.modifieddate,jdbcType=TIMESTAMP}, #{stockInfo.flag,jdbcType=TINYINT}, SELECT LAST_INSERT_ID() update stock${slice} productid = #{stockInfo.productid,jdbcType=BIGINT}, directioncode = #{stockInfo.directioncode,jdbcType=VARCHAR}, directionboxcode = #{stockInfo.directionboxcode,jdbcType=VARCHAR}, num = #{stockInfo.num,jdbcType=INTEGER}, owner = #{stockInfo.owner,jdbcType=VARCHAR}, status = #{stockInfo.status,jdbcType=VARCHAR}, indate = #{stockInfo.indate,jdbcType=TIMESTAMP}, outdate = #{stockInfo.outdate,jdbcType=TIMESTAMP}, operator = #{stockInfo.operator,jdbcType=VARCHAR}, type = #{stockInfo.type,jdbcType=TINYINT}, remark = #{stockInfo.remark,jdbcType=VARCHAR}, createdby = #{stockInfo.createdby,jdbcType=VARCHAR}, createddate = #{stockInfo.createddate,jdbcType=TIMESTAMP}, modifiedby = #{stockInfo.modifiedby,jdbcType=VARCHAR}, modifieddate = #{stockInfo.modifieddate,jdbcType=TIMESTAMP}, flag = #{stockInfo.flag,jdbcType=TINYINT}, where id = #{stockInfo.id,jdbcType=BIGINT} UPDATE stock${slice} AS stock LEFT JOIN enterprise ON enterprise.id = stock.`owner` LEFT JOIN product ON product.id = stock.productid AND product.isdel = 0 stock.owner = '', stock.modifieddate = #{date}, stock.remark = #{remark} where `status` = '' AND stock.`owner` = #{owner} AND enterprise.validflag = 1 AND enterprise.enterprisestatus = 'ON' UPDATE stock${slice} AS stock LEFT JOIN enterprise ON enterprise.id = stock.`owner` LEFT JOIN product ON product.id = stock.productid AND product.isdel = 0 stock.owner = '', stock.modifieddate = #{date}, stock.remark = #{remark} where `status` = '' AND stock.`owner` = #{owner} AND enterprise.validflag = 1 AND enterprise.enterprisestatus = 'ON' AND product.directioncode IN #{item}