zhangjinli 3 years ago
parent 5e53f90e94
commit f0ae15ad95

@ -347,20 +347,33 @@ public class TaskController {
return Result.success(res);
}
@Data
static class CNListParam {
@Schema(title = "姓名")
private String name;
@Schema(title = "手机号")
private String tel;
@Schema(title = "车型")
private String brand;
@Schema(title = "提交人")
private String providerName;
@Schema(title = "部门id")
private Integer departmentId;
private Integer pageNum;
private Integer pageSize;
}
@Operation(summary = "线索搜集列表")
@PostMapping("/customerNoteList")
@adminTokenValid
public Result customerNote(@RequestBody JSONObject obj) {
public Result customerNote(@RequestBody CNListParam param) {
QueryWrapper<CustomerActionNote> qw = new QueryWrapper<>();
String keywords = obj.getString("keywords");
if (keywords != null) {
qw.and(
wrapper ->
wrapper.like("t1.customerName", keywords).or().like("t3.title", keywords).like("t1.tel", keywords)
.or().like("t1.area", keywords).or().like("t1.remarks", keywords).or().like("t1.brandList", keywords)
);
}
IPage<Map> iPage = customerActionNoteService.pageList(MybatisPlusUtil.SetPage(obj), null, qw);
qw.like(param.getName()!=null,"t1.customerName" ,param.getName());
qw.like(param.getTel()!=null,"t1.tel" ,param.getTel());
qw.like(param.getBrand()!=null,"t1.brandList" ,param.getBrand());
qw.like(param.getProviderName()!=null,"t2.name" ,param.getProviderName());
qw.eq(param.getDepartmentId()!=null,"t4.departmentId" ,param.getDepartmentId());
IPage<Map> iPage = customerActionNoteService.pageList(MybatisPlusUtil.SetNumPage(param.getPageNum(), param.getPageSize()), null, qw);
List<Map> records = iPage.getRecords();
for (Map m : records) {
if (m.get("brandList") != null) {

@ -20,9 +20,10 @@ import java.util.Map;
*/
public interface CustomerActionNoteMapper extends BaseMapper<CustomerActionNote> {
@Select("<script> " +
"select t1.*,t2.name as provideName,t3.title as taskTitle\n" +
"select t1.*,t2.name as provideName,t3.title as taskTitle, t4.departmentId,t4.name as departmentName\n" +
"from customerActionNote as t1\n" +
"LEFT JOIN user as t2 on t1.provideId = t2.id\n" +
"LEFT JOIN qywxDepartment as t4 on t4.departmentId = t2.main_department\n" +
"LEFT JOIN task as t3 on t1.taskId = t3.id\n"+
"<if test='openid!=null'>where t2.openid =#{openid} </if>" +

Loading…
Cancel
Save