| | |
| | | public Response getBomHistoryByPModelAndSName(@RequestParam String pmodel, @RequestParam String sname){ |
| | | return service.getBomHistoryByPModelAndSName(pmodel,sname); |
| | | } |
| | | |
| | | @ApiOperation(tags="产品管理",value = "查询产品的最大版本信息") |
| | | @GetMapping("getMaxBoom") |
| | | public Response getMaxBoom(@RequestParam String parentCode,@RequestParam String parentName,@RequestParam String parentModel){ |
| | | return service.getMaxBoom(parentCode,parentName,parentModel); |
| | | } |
| | | } |
| | |
| | | |
| | | public interface ProductBomHistoryMapper extends CustomMapper<ProductBomHistory> { |
| | | void updateVersionBatch(List<ProductBomHistory> newVersionCurrentHistoryList); |
| | | |
| | | //查询产品的最大版本信息 |
| | | int selectMaxVersion(String parentCode, String parentName, String parentModel); |
| | | } |
| | |
| | | public void updateVersionBatch(List<ProductBomHistory> newVersionCurrentHistoryList) { |
| | | mapper.updateVersionBatch(newVersionCurrentHistoryList); |
| | | } |
| | | //查询产品的最大版本信息 |
| | | public Response getMaxBoom(String parentCode, String parentName, String parentModel) { |
| | | int maxVersion=mapper.selectMaxVersion(parentCode,parentName,parentModel); |
| | | return new Response().setII(1,maxVersion>=0?true:false,maxVersion,"返回最大版本"); |
| | | } |
| | | } |
| | |
| | | * 获取所有产品信息*/ |
| | | public Response getAllBom() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.select("distinct parent_code","parent_name","parent_model").orderByAsc("id"); |
| | | wrapper.select("distinct parent_code","parent_name","parent_model","version").orderByAsc("id"); |
| | | List list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list!=null?true:false,list,"返回数据"); |
| | | } |
| | |
| | | update db_doc.tb_product_bom_history set e_version = #{his.eVersion} where id = #{his.id} |
| | | </foreach> |
| | | </update> |
| | | <select id="selectMaxVersion" resultType="java.lang.Integer"> |
| | | select ifNull(max(e_version),-1) from db_doc.tb_product_bom_history |
| | | <where> |
| | | parent_code=#{parentCode} and parent_name=#{parentName} and parent_model=#{parentModel} |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | </mapper> |