Commit 707c19cc by songyinghui

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

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