src/main/java/com/whyc/controller/ProductLockLogController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/ProductLockLogService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/ProductLockLogController.java
New file @@ -0,0 +1,31 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.ProductLockLog; import com.whyc.service.ProductLockLogService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @Api(tags = "产品锁定日志") @RestController @RequestMapping("productLockLog") public class ProductLockLogController { @Autowired private ProductLockLogService service; @ApiOperation("查询列表-根据母料编码和定制表单号") @GetMapping public Response getListByParentCodeAndCustomCode(@RequestParam String parentCode,@RequestParam String customCode){ List<ProductLockLog> lockLogList = service.getListByParentCodeAndCustomCode(parentCode,customCode); return new Response().set(1,lockLogList); } } src/main/java/com/whyc/service/ProductLockLogService.java
@@ -1,10 +1,13 @@ package com.whyc.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.whyc.mapper.ProductLockLogMapper; import com.whyc.pojo.ProductLockLog; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class ProductLockLogService { @@ -15,4 +18,10 @@ public void insert(ProductLockLog lockLog) { mapper.insert(lockLog); } public List<ProductLockLog> getListByParentCodeAndCustomCode(String parentCode, String customCode) { QueryWrapper<ProductLockLog> query = Wrappers.query(); query.eq("parent_code",parentCode).eq("custom_code",customCode); return mapper.selectList(query); } }