Commit 707c19cc by songyinghui

feat: 欢迎语关联列表 支持模糊查询

parent fda75f6b
......@@ -12,6 +12,8 @@ public class QueryWelcomeRelationQDTO extends BasePageInfo {
private String welcomeId ;
private String searchContent;
public String getWelcomeId() {
return welcomeId;
}
......@@ -19,4 +21,12 @@ public class QueryWelcomeRelationQDTO extends BasePageInfo {
public void setWelcomeId(String welcomeId) {
this.welcomeId = welcomeId;
}
public String getSearchContent() {
return searchContent;
}
public void setSearchContent(String searchContent) {
this.searchContent = searchContent;
}
}
......@@ -15,6 +15,8 @@ public class WelcomeRelationQO extends BasePageInfo {
private Integer status;
private String searchContent;
public String getWelcomeId() {
return welcomeId;
}
......@@ -30,4 +32,12 @@ public class WelcomeRelationQO extends BasePageInfo {
public void setStatus(Integer status) {
this.status = status;
}
public String getSearchContent() {
return searchContent;
}
public void setSearchContent(String searchContent) {
this.searchContent = searchContent;
}
}
......@@ -40,6 +40,7 @@ public class HmWelcomeRelationApiServiceImpl implements HmWelcomeRelationApiServ
WelcomeRelationQO welcomeRelationQo = new WelcomeRelationQO();
welcomeRelationQo.setWelcomeId(queryWelcomeRelationQdto.getWelcomeId());
welcomeRelationQo.setStatus(WelcomeRelationStatusEnum.ENABLE.getCode());
welcomeRelationQo.setSearchContent(queryWelcomeRelationQdto.getSearchContent());
Page<HmWelcomeRelationBO> welcomeRelationPage = welcomeRelationService.queryWelcomeRelationPage(welcomeRelationQo);
Page<HmWelcomeRelationDTO> welcomeRelationDTOPage = PageUtil.changeToCurrentPage(welcomeRelationPage, HmWelcomeRelationDTO.class);
return ServiceResponse.success(welcomeRelationDTOPage);
......
......@@ -177,6 +177,9 @@
<if test="status != null">
and `status` = #{status}
</if>
<if test="searchContent != null and searchContent != ''">
and (refer_code = #{searchContent} or refer_name like CONCAT('%', #{searchContent}, '%') )
</if>
</where>
</select>
......
......@@ -6,13 +6,16 @@ import com.gic.haoban.manage.api.dto.hm.HmGroupDTO;
import com.gic.haoban.manage.api.dto.hm.HmGroupQueryDTO;
import com.gic.haoban.manage.api.dto.hm.HmPageDTO;
import com.gic.haoban.manage.api.dto.hm.HmPageRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmWelcomeRelationDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.service.hm.HmGroupApiService;
import com.gic.haoban.manage.api.service.hm.HmPageApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService;
import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.service.hm.WelcomeRelationService;
import org.junit.Test;
......@@ -37,6 +40,9 @@ public class HmPageServiceTest {
@Autowired
private HmGroupApiService groupService;
@Autowired
private HmWelcomeRelationApiService welcomeRelationApiService;
@Test
public void test(){
HmPageQDTO pageQDTO = new HmPageQDTO();
......@@ -119,4 +125,13 @@ public class HmPageServiceTest {
System.out.println(JSON.toJSONString(booleanServiceResponse));
}
@Test
public void welcomeTest(){
QueryWelcomeRelationQDTO qdto = new QueryWelcomeRelationQDTO();
qdto.setWelcomeId("04af9e55515d4352be0b2a3119005ce9");
//qdto.setSearchContent("测试");
ServiceResponse<Page<HmWelcomeRelationDTO>> serviceResponse = welcomeRelationApiService.queryWelcomeRelation(qdto);
System.out.println(JSON.toJSONString(serviceResponse));
}
}
......@@ -326,9 +326,11 @@ public class WelcomeController extends WebBaseController {
@RequestMapping(path = "/relation/list")
public RestResponse<Page<HmWelcomeRelationDTO>> queryWelcomeRelationList(@RequestParam("welcomeId") String welcomeId,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(value = "searchContent", required = false) String searchContent) {
QueryWelcomeRelationQDTO queryWelcomeRelationQDTO = new QueryWelcomeRelationQDTO();
queryWelcomeRelationQDTO.setWelcomeId(welcomeId);
queryWelcomeRelationQDTO.setSearchContent(searchContent);
queryWelcomeRelationQDTO.setPageNum(pageNum);
queryWelcomeRelationQDTO.setPageSize(pageSize);
ServiceResponse<Page<HmWelcomeRelationDTO>> serviceResponse = welcomeRelationApiService.queryWelcomeRelation(queryWelcomeRelationQDTO);
......
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