1. 优化代码

topo_dev
xueqingkun 10 months ago
parent 2657955b07
commit cdb9472531

@ -4,13 +4,14 @@ import com.supervision.common.domain.R;
import com.supervision.police.domain.CasePerson; import com.supervision.police.domain.CasePerson;
import com.supervision.police.domain.ModelCase; import com.supervision.police.domain.ModelCase;
import com.supervision.police.service.ModelCaseService; import com.supervision.police.service.ModelCaseService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@RestController @RestController
@Slf4j @Slf4j
@RequestMapping("modelCase") @RequestMapping("modelCase")
@ -64,14 +65,14 @@ public class ModelCaseController {
} }
/** /**
* *
* @param name * @param name
* @return * @return
*/ */
@GetMapping("/getPerson") @GetMapping("/getPerson")
@Operation(summary = "getPersion") @Operation(summary = "查询案件人员信息列表")
public R<?> getPerson(@RequestParam String caseId, public R<List<CasePerson>> getPerson(@RequestParam String caseId,
@RequestParam(required = false, defaultValue = "") String name) { @RequestParam(required = false, defaultValue = "") String name) {
return modelCaseService.getPerson(caseId, name); return modelCaseService.getPerson(caseId, name);
} }

@ -20,7 +20,7 @@ import java.util.List;
* @since 2024-07-05 09:20:10 * @since 2024-07-05 09:20:10
*/ */
@RestController @RestController
@RequestMapping("modelIndex") @RequestMapping("/modelIndex")
public class ModelIndexController { public class ModelIndexController {
@Autowired @Autowired

@ -6,6 +6,8 @@ import com.supervision.police.domain.CasePerson;
import com.supervision.police.domain.ModelCase; import com.supervision.police.domain.ModelCase;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/** /**
* (ModelCase) * (ModelCase)
* *
@ -22,7 +24,7 @@ public interface ModelCaseService extends IService<ModelCase> {
R<?> del(String id); R<?> del(String id);
R<?> getPerson(String caseId, String name); R<List<CasePerson>> getPerson(String caseId, String name);
R<?> addPersion(CasePerson person); R<?> addPersion(CasePerson person);

@ -120,7 +120,7 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
} }
@Override @Override
public R<?> getPerson(String caseId, String name) { public R<List<CasePerson>> getPerson(String caseId, String name) {
LambdaQueryWrapper<CasePerson> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<CasePerson> wrapper = Wrappers.lambdaQuery();
wrapper.like(CasePerson::getCaseId, caseId) wrapper.like(CasePerson::getCaseId, caseId)
.like(CasePerson::getName, name); .like(CasePerson::getName, name);

Loading…
Cancel
Save