Commit 6b9e348e authored by lining's avatar lining

feat: 估价员接口

parent bda7aca8
......@@ -4,8 +4,10 @@
<select id="selectByNameLike" resultType="com.onsiteservice.entity.user.User">
select * from user
where user_name like '%${name}%'
and role_type = ${@com.onsiteservice.constant.enums.ServiceUserTypeEnum@VALUATOR.getId()}
where role_type = ${@com.onsiteservice.constant.enums.ServiceUserTypeEnum@VALUATOR.getId()}
<if test="name !='' and test !=null ">
and user_name like '%${name}%'
</if>
order by create_time asc
</select>
......
......@@ -40,8 +40,8 @@ public class ServiceValuatorController {
}
@ApiOperation(value = "根据姓名查询")
@GetMapping("get/{name}")
public Result<List<ServiceValuatorVO>> getDetails(@ApiParam(name = "name", value = "估价员姓名") @PathVariable @NotBlank String name) {
@GetMapping("get")
public Result<List<ServiceValuatorVO>> getDetails(@ApiParam(name = "name", value = "估价员姓名") @RequestParam(required = false) String name) {
return success(serviceValuatorService.selectByName(name));
}
......
......@@ -12,6 +12,7 @@ import com.onsiteservice.entity.user.User;
import com.onsiteservice.miniapp.controller.worker.vo.ServiceValuatorVO;
import com.onsiteservice.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -52,7 +53,7 @@ public class ServiceValuatorService extends AbstractMapper<ServiceValuator> {
public List<ServiceValuatorVO> selectByName(String name) {
log.info("valuator selectByName name: {}", name);
List<User> userList = userMapper.selectByNameLike(name);
List<User> userList = userMapper.selectByNameLike(StringUtils.isBlank(name) ? null : name.trim());
return handle(userList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment