| | |
| | | |
| | | @ApiOperation(value = "验证母料编码是否存在产品中") |
| | | @GetMapping("judgeParentCode") |
| | | public Response judgeParentCode(@RequestParam String parentCode){ |
| | | return service.judgeParentCode(parentCode); |
| | | public Response judgeParentCode(@RequestParam String parentCode,@RequestParam(required = false) String customCode){ |
| | | return service.judgeParentCode(parentCode,customCode); |
| | | } |
| | | } |
| | |
| | | //查询产品是否存在物料时钣金件的产品 |
| | | List<Material> selectMaterial_0120(String parentCode, String customCode); |
| | | //验证母料编码是否存在产品中 |
| | | int judgeParentCode(@Param("parentCode") String parentCode); |
| | | int judgeParentCode(@Param("parentCode") String parentCode,String customCode); |
| | | } |
| | |
| | | return object -> seen.putIfAbsent(keyExtractor.apply(object), Boolean.TRUE) == null; |
| | | } |
| | | //验证母料编码是否存在产品中 |
| | | public Response judgeParentCode(String parentCode) { |
| | | int count = mapper.judgeParentCode(parentCode); |
| | | public Response judgeParentCode(String parentCode,String customCode) { |
| | | int count = mapper.judgeParentCode(parentCode,customCode); |
| | | return new Response().set(1,count>0,"验证母料编码是否存在产品中"); |
| | | } |
| | | } |
| | |
| | | </where> |
| | | </select> |
| | | <select id="judgeParentCode" resultType="java.lang.Integer"> |
| | | select count(*) from tb_product where parent_code like '%${parentCode}%' |
| | | select count(*) from tb_product |
| | | <where> |
| | | <if test="parentCode!=null"> |
| | | and parent_code like '%${parentCode}%' |
| | | </if> |
| | | <if test="customCode!=null"> |
| | | <if test="customCode==''"> |
| | | and custom_code=#{customCode} |
| | | </if> |
| | | <if test="customCode!=''"> |
| | | and custom_code like '%${customCode}%' |
| | | </if> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |