Commit 0781adb6 authored by zhengyi's avatar zhengyi

联系人下拉框搜索补充电话搜索参数查询业务

parent 2b49ea4c
...@@ -83,6 +83,9 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO> ...@@ -83,6 +83,9 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
"<when test = 'searchKey != null and searchKey != \"\" '>", "<when test = 'searchKey != null and searchKey != \"\" '>",
"and CONCAT(IFNULL(cc.`name`,''),IFNULL(cc.`name_en`,''),IFNULL(cc.`phone_new`,''),IFNULL(cc.`email`,''),IFNULL(c.`company`,''),IFNULL(c.`company_en`,'')) like concat('%', concat(#{searchKey}, '%'))", "and CONCAT(IFNULL(cc.`name`,''),IFNULL(cc.`name_en`,''),IFNULL(cc.`phone_new`,''),IFNULL(cc.`email`,''),IFNULL(c.`company`,''),IFNULL(c.`company_en`,'')) like concat('%', concat(#{searchKey}, '%'))",
"</when>", "</when>",
"<when test = 'phone != null and phone != \"\" '>",
"and IFNULL(cc.`phone_new`,'') like concat('%', concat(#{phone}, '%'))",
"</when>",
"<when test = 'type != null and type != \"\" '>", "<when test = 'type != null and type != \"\" '>",
"and FIND_IN_SET(#{type}, c.type) ", "and FIND_IN_SET(#{type}, c.type) ",
"</when>", "</when>",
...@@ -98,6 +101,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO> ...@@ -98,6 +101,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
}) })
IPage<CustomerContactsDto> selectBySearchKey(IPage page, IPage<CustomerContactsDto> selectBySearchKey(IPage page,
@Param("searchKey") String searchKey, @Param("searchKey") String searchKey,
@Param("phone") String phone,
@Param("type") String type, @Param("type") String type,
@Param("ids") Collection<Long> ids, @Param("ids") Collection<Long> ids,
@Param("customerId") Long customerId); @Param("customerId") Long customerId);
...@@ -145,6 +149,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO> ...@@ -145,6 +149,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
//过滤客户经理函数 //过滤客户经理函数
IPage<CustomerContactsDto> selectBySearchKey2(IPage page, IPage<CustomerContactsDto> selectBySearchKey2(IPage page,
@Param("searchKey") String searchKey, @Param("searchKey") String searchKey,
@Param("phone") String phone,
@Param("type") String type, @Param("type") String type,
@Param("ids") Collection<Long> ids, @Param("ids") Collection<Long> ids,
@Param("customerId") Long customerId, @Param("customerId") Long customerId,
......
...@@ -107,14 +107,14 @@ public interface CustomerContactsService extends IService<CustomerContactsDO> { ...@@ -107,14 +107,14 @@ public interface CustomerContactsService extends IService<CustomerContactsDO> {
* @param customerId 客户ID * @param customerId 客户ID
* @return 联系人列表 * @return 联系人列表
*/ */
PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String type, Collection<Long> ids, Long customerId, PageParam page); PageResult<CustomerContactsDto> selectBySearchKey(String searchKey,String phone, String type, Collection<Long> ids, Long customerId, PageParam page);
/* /*
添加的客户选择函数 添加的客户选择函数
*/ */
PageResult<CustomerContactsDto> selectBySearchKey2( PageResult<CustomerContactsDto> selectBySearchKey2(
String searchKey, String type, Collection<Long> ids, String searchKey, String phone, String type, Collection<Long> ids,
Long customerId, PageParam page, Long UserId); Long customerId, PageParam page, Long UserId);
......
...@@ -146,9 +146,9 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact ...@@ -146,9 +146,9 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact
} }
@Override @Override
public PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String type, Collection<Long> ids, Long customerId, PageParam page) { public PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String phone, String type, Collection<Long> ids, Long customerId, PageParam page) {
IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page); IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page);
customerContactsMapper.selectBySearchKey(mpPage, searchKey, customerContactsMapper.selectBySearchKey(mpPage, searchKey, phone,
type, ids, customerId); type, ids, customerId);
return PageResult.of(mpPage); return PageResult.of(mpPage);
...@@ -157,13 +157,14 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact ...@@ -157,13 +157,14 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact
@Override @Override
public PageResult<CustomerContactsDto> selectBySearchKey2( public PageResult<CustomerContactsDto> selectBySearchKey2(
String searchKey, String searchKey,
String phone,
String type, String type,
Collection<Long> ids, Collection<Long> ids,
Long customerId, Long customerId,
PageParam page, PageParam page,
Long UserId) { Long UserId) {
IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page); IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page);
customerContactsMapper.selectBySearchKey2(mpPage, searchKey, customerContactsMapper.selectBySearchKey2(mpPage, searchKey, phone,
type, ids, customerId,UserId); type, ids, customerId,UserId);
return PageResult.of(mpPage); return PageResult.of(mpPage);
......
...@@ -164,19 +164,21 @@ public class CustomerContactsController { ...@@ -164,19 +164,21 @@ public class CustomerContactsController {
@ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)") @ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class), @ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "姓名或电话", dataTypeClass = String.class), @ApiImplicitParam(name = "phone", value = "请输入联系人电话搜索", example = "电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "1", dataTypeClass = String.class),
@ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class), @ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class),
@ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class)
}) })
public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey( public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey(
@RequestParam(value = "searchKey", required = false) String searchKey, @RequestParam(value = "searchKey", required = false) String searchKey,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "type", required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "ids", required = false) Collection<Long> ids, @RequestParam(value = "ids", required = false) Collection<Long> ids,
@RequestParam(value = "customerId", required = false) Long customerId @RequestParam(value = "customerId", required = false) Long customerId
, PageParam page) { , PageParam page) {
Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return success(customerContactsService.selectBySearchKey(searchKey, return success(customerContactsService.selectBySearchKey(searchKey, phone,
type, ids, customerId, page)); type, ids, customerId, page));
} }
...@@ -188,12 +190,14 @@ public class CustomerContactsController { ...@@ -188,12 +190,14 @@ public class CustomerContactsController {
@ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)") @ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class), @ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "phone", value = "请输入联系人电话搜索", example = "电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "姓名或电话", dataTypeClass = String.class), @ApiImplicitParam(name = "type", value = "客户类型", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class), @ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class),
@ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class)
}) })
public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey2( public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey2(
@RequestParam(value = "searchKey", required = false) String searchKey, @RequestParam(value = "searchKey", required = false) String searchKey,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "type", required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "ids", required = false) Collection<Long> ids, @RequestParam(value = "ids", required = false) Collection<Long> ids,
@RequestParam(value = "customerId", required = false) Long customerId @RequestParam(value = "customerId", required = false) Long customerId
...@@ -205,7 +209,7 @@ public class CustomerContactsController { ...@@ -205,7 +209,7 @@ public class CustomerContactsController {
type, ids, customerId, page));*/ type, ids, customerId, page));*/
//当前用户ID //当前用户ID
Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return success(customerContactsService.selectBySearchKey2(searchKey, return success(customerContactsService.selectBySearchKey2(searchKey, phone,
type, ids, customerId, page, loginUserId)); type, ids, customerId, page, loginUserId));
} }
......
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