insert into jsh_serial_number (material_Id, serial_Number, is_Sell, remark,delete_Flag, create_Time, creator,update_Time, updater,depothead_Id) values (#{materialId},#{serialNumber},#{isSell},#{remark},#{deleteFlag}, #{createTime},#{creator},#{updateTime},#{updater},#{depotheadId} ) update jsh_serial_number material_Id = #{materialId,jdbcType=BIGINT}, serial_Number = #{serialNumber,jdbcType=VARCHAR}, is_Sell = #{isSell,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR}, delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, update_Time = #{updateTime,jdbcType=TIMESTAMP}, updater = #{updater,jdbcType=BIGINT}, depothead_Id = #{depotheadId,jdbcType=BIGINT}, where id = #{id,jdbcType=BIGINT} update jsh_serial_number is_Sell = '1', depothead_Id = #{depotheadId}, update_Time = #{updateTime}, updater = #{updater}, where 1=1 and material_Id = #{materialId} and is_Sell != '1' and id in ( select batchSN.id from ( select selFrom.id from jsh_serial_number selFrom where 1=1 and selFrom.material_Id = #{materialId} and selFrom.is_Sell != '1' limit 0,#{count} ) batchSN ) update jsh_serial_number is_Sell = '0', update_Time = #{updateTime}, updater = #{updater}, where 1=1 and material_Id = #{materialId} and depothead_Id = #{depotheadId,jdbcType=BIGINT} and is_Sell != '0' and id in ( select batchSN.id from ( select selFrom.id from jsh_serial_number selFrom where 1=1 and selFrom.material_Id = #{materialId} and selFrom.depothead_Id = #{depotheadId,jdbcType=BIGINT} and selFrom.is_Sell !='0' limit 0,#{count} ) batchSN ) insert into jsh_serial_number (material_Id, serial_Number, is_Sell, remark,delete_Flag, create_Time, creator,update_Time, updater) values (#{each.materialId},#{each.serialNumber},'0',#{each.remark},'0', #{each.createTime},#{each.creator},#{each.updateTime},#{each.updater} )