临时提交

This commit is contained in:
648540858
2024-07-29 17:44:34 +08:00
parent e285257f24
commit 112cb2dfd8
9 changed files with 197 additions and 20 deletions

View File

@@ -86,13 +86,15 @@ public class CommonChannelController {
@Parameter(name = "count", description = "每页查询数量", required = true)
@Parameter(name = "query", description = "查询内容")
@Parameter(name = "online", description = "是否在线")
@Parameter(name = "hasCivilCode", description = "是否分配行政区划")
@GetMapping("/list")
public PageInfo<CommonGBChannel> queryList(int page, int count,
@RequestParam(required = false) String query,
@RequestParam(required = false) Boolean online){
@RequestParam(required = false) Boolean online,
@RequestParam(required = false) Boolean hasCivilCode){
if (ObjectUtils.isEmpty(query)){
query = null;
}
return channelService.queryList(page, count, query, online);
return channelService.queryList(page, count, query, online, hasCivilCode);
}
}

View File

@@ -306,7 +306,7 @@ public interface CommonGBChannelMapper {
CommonGBChannel queryByStreamProxyId(@Param("streamProxyId") Integer streamProxyId);
@SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(String query, Boolean online);
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, @Param("hasCivilCode") Boolean hasCivilCode);
@Select("<script>" +
" select " +

View File

@@ -83,6 +83,12 @@ public class ChannelProvider {
if (params.get("online") != null && !(Boolean)params.get("online")) {
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
}
if (params.get("hasCivilCode") != null && (Boolean)params.get("hasCivilCode")) {
sqlBuild.append(" AND gb_civil_code is not null");
}
if (params.get("hasCivilCode") != null && !(Boolean)params.get("hasCivilCode")) {
sqlBuild.append(" AND gb_civil_code is null");
}
return sqlBuild.toString();
}

View File

@@ -41,7 +41,7 @@ public interface IGbChannelService {
void reset(int id);
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online);
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode);
void removeCivilCode(List<Region> allChildren);
}

View File

@@ -319,9 +319,9 @@ public class GbChannelServiceImpl implements IGbChannelService {
}
@Override
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online) {
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasCivilCode) {
PageHelper.startPage(page, count);
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online);
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasCivilCode);
return new PageInfo<>(all);
}