| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AttachLockMapper; |
| | | import com.whyc.pojo.AttachLock; |
| | |
| | | }); |
| | | return new Response().set(1,true,""); |
| | | } |
| | | |
| | | public void getAndInsert(Integer materialIdInDB, Integer materialId) { |
| | | QueryWrapper<AttachLock> query = Wrappers.query(); |
| | | query.eq("material_id",materialIdInDB).eq("lock_flag",1).eq("product_id",0); |
| | | List<AttachLock> attachLocksInDB = mapper.selectList(query); |
| | | |
| | | attachLocksInDB.forEach(attachLock -> { |
| | | attachLock.setId(null); |
| | | attachLock.setMaterialId(materialId); |
| | | }); |
| | | if(attachLocksInDB.size()!=0) { |
| | | mapper.insertBatchSomeColumn(attachLocksInDB); |
| | | } |
| | | } |
| | | } |