Commit e325c69c authored by hkl's avatar hkl

Merge branch 'dev-hkl' into 'master'

Dev hkl

See merge request !1
parents 66c23824 accfedad
This diff is collapsed.
package org.jeecg.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("统一分页查询")
public class PageSearch<T> {
@ApiModelProperty(value = "当前页码")
private Integer pageNo = 1;
@ApiModelProperty(value = "每页记录数")
private Integer pageSize = 10;
@ApiModelProperty(value = "查询载体")
private T query;
}
...@@ -112,11 +112,10 @@ public class Swagger2Config implements WebMvcConfigurer { ...@@ -112,11 +112,10 @@ public class Swagger2Config implements WebMvcConfigurer {
.title("JeecgBoot 后台服务API接口文档") .title("JeecgBoot 后台服务API接口文档")
// 版本号 // 版本号
.version("1.0") .version("1.0")
// .termsOfServiceUrl("NO terms of service")
// 描述 // 描述
.description("后台API接口") .description("后台API接口")
// 作者 // 作者
.contact(new Contact("北京敲敲云科技有限公司","www.jeccg.com","jeecgos@163.com")) .contact(new Contact(" "," "," "))
.license("The Apache License, Version 2.0") .license("The Apache License, Version 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.build(); .build();
......
//package org.jeecg.config.mybatis;
//
//import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
//import net.sf.jsqlparser.expression.BinaryExpression;
//import net.sf.jsqlparser.expression.Expression;
//import net.sf.jsqlparser.expression.Parenthesis;
//import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
//import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
//import net.sf.jsqlparser.expression.operators.relational.*;
//import net.sf.jsqlparser.schema.Column;
//import net.sf.jsqlparser.schema.Table;
//import net.sf.jsqlparser.statement.select.*;
//
//import java.util.List;
//
///**
// * 复写租户条件
// */
//public class JeecgTenantParser extends TenantSqlParser {
//
// /**
// * @param expression
// * @param table
// * @return
// */
// protected Expression processTableAlias(Expression expression, Table table) {
// String tableAliasName;
// if (table.getAlias() == null) {
// tableAliasName = table.getName();
// } else {
// tableAliasName = table.getAlias().getName();
// }
//
// // in
// if (expression instanceof InExpression) {
// InExpression in = (InExpression) expression;
// if (in.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) in.getLeftExpression(), tableAliasName);
// }
//
// // 比较操作
// } else if (expression instanceof BinaryExpression) {
// BinaryExpression compare = (BinaryExpression) expression;
// if (compare.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) compare.getLeftExpression(), tableAliasName);
// } else if (compare.getRightExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) compare.getRightExpression(), tableAliasName);
// }
//
// // between
// } else if (expression instanceof Between) {
// Between between = (Between) expression;
// if (between.getLeftExpression() instanceof Column) {
// setTableAliasNameForColumn((Column) between.getLeftExpression(), tableAliasName);
// }
// }
// return expression;
// }
//
// private void setTableAliasNameForColumn(Column column, String tableAliasName) {
// column.setColumnName(tableAliasName + "." + column.getColumnName());
// }
//
// /**
// * 默认是按 tenant_id=1 按等于条件追加
// *
// * @param currentExpression 现有的条件:比如你原来的sql查询条件
// * @param table
// * @return
// */
// @Override
// protected Expression builderExpression(Expression currentExpression, Table table) {
// final Expression tenantExpression = this.getTenantHandler().getTenantId(true);
// Expression appendExpression;
// if (!(tenantExpression instanceof SupportsOldOracleJoinSyntax)) {
// appendExpression = new EqualsTo();
// ((EqualsTo) appendExpression).setLeftExpression(this.getAliasColumn(table));
// ((EqualsTo) appendExpression).setRightExpression(tenantExpression);
// } else {
// appendExpression = processTableAlias(tenantExpression, table);
// }
// if (currentExpression == null) {
// return appendExpression;
// }
// if (currentExpression instanceof BinaryExpression) {
// BinaryExpression binaryExpression = (BinaryExpression) currentExpression;
// if (binaryExpression.getLeftExpression() instanceof FromItem) {
// processFromItem((FromItem) binaryExpression.getLeftExpression());
// }
// if (binaryExpression.getRightExpression() instanceof FromItem) {
// processFromItem((FromItem) binaryExpression.getRightExpression());
// }
// } else if (currentExpression instanceof InExpression) {
// InExpression inExp = (InExpression) currentExpression;
// ItemsList rightItems = inExp.getRightItemsList();
// if (rightItems instanceof SubSelect) {
// processSelectBody(((SubSelect) rightItems).getSelectBody());
// }
// }
// if (currentExpression instanceof OrExpression) {
// return new AndExpression(new Parenthesis(currentExpression), appendExpression);
// } else {
// return new AndExpression(currentExpression, appendExpression);
// }
// }
//
// @Override
// protected void processPlainSelect(PlainSelect plainSelect, boolean addColumn) {
// FromItem fromItem = plainSelect.getFromItem();
// if (fromItem instanceof Table) {
// Table fromTable = (Table) fromItem;
// if (!this.getTenantHandler().doTableFilter(fromTable.getName())) {
// plainSelect.setWhere(builderExpression(plainSelect.getWhere(), fromTable));
// if (addColumn) {
// plainSelect.getSelectItems().add(new SelectExpressionItem(new Column(this.getTenantHandler().getTenantIdColumn())));
// }
// }
// } else {
// processFromItem(fromItem);
// }
// List<Join> joins = plainSelect.getJoins();
// if (joins != null && joins.size() > 0) {
// joins.forEach(j -> {
// processJoin(j);
// processFromItem(j.getRightItem());
// });
// }
// }
//
//}
//package org.jeecg.config.mybatis;
//
//import lombok.extern.slf4j.Slf4j;
//
///**
// * 多租户 tenant_id存储器
// * @author: jeecg-boot
// */
//@Slf4j
//public class TenantContext {
// private static ThreadLocal<String> currentTenant = new ThreadLocal<>();
//
// public static void setTenant(String tenant) {
// log.debug(" setting tenant to " + tenant);
// currentTenant.set(tenant);
// }
//
// public static String getTenant() {
// return currentTenant.get();
// }
//
// public static void clear(){
// currentTenant.remove();
// }
//}
...@@ -4,8 +4,11 @@ import java.util.Arrays; ...@@ -4,8 +4,11 @@ import java.util.Arrays;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.service.ILightRailService; import org.jeecg.modules.subwayNetwork.service.ILightRailService;
...@@ -15,6 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -15,6 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
...@@ -40,52 +44,28 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -40,52 +44,28 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
/** /**
* 分页列表查询 * 分页列表查询
* *
* @param lightRail
* @param pageNo
* @param pageSize
* @param req
* @return * @return
*/ */
//@AutoLog(value = "线路车站-轻轨线路-分页列表查询") @AutoLog(value = "线路车站-轻轨线路-分页列表查询")
@ApiOperation(value = "线路车站-轻轨线路-分页列表查询", notes = "线路车站-轻轨线路-分页列表查询") @ApiOperation(value = "线路车站-轻轨线路-分页列表查询", notes = "线路车站-轻轨线路-分页列表查询")
@GetMapping(value = "/list") @PostMapping(value = "/list")
public Result<IPage<LightRail>> queryPageList(LightRail lightRail, public Result<IPage<LightRailQueryVO>> queryPageList(@RequestBody PageSearch<LightRailQueryDTO> dto) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, IPage<LightRailQueryVO> pageList = lightRailService.queryPageList(dto);
HttpServletRequest req) {
QueryWrapper<LightRail> queryWrapper = QueryGenerator.initQueryWrapper(lightRail, req.getParameterMap());
Page<LightRail> page = new Page<LightRail>(pageNo, pageSize);
IPage<LightRail> pageList = lightRailService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 添加
*
* @param lightRail
* @return
*/
@AutoLog(value = "线路车站-轻轨线路-添加")
@ApiOperation(value = "线路车站-轻轨线路-添加", notes = "线路车站-轻轨线路-添加")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody LightRail lightRail) {
lightRailService.save(lightRail);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param lightRail
* @return
*/
@AutoLog(value = "线路车站-轻轨线路-编辑") @AutoLog(value = "线路车站-轻轨线路-编辑")
@ApiOperation(value = "线路车站-轻轨线路-编辑", notes = "线路车站-轻轨线路-编辑") @ApiOperation(value = "线路车站-轻轨线路-编辑", notes = "线路车站-轻轨线路-编辑")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:edit") @PostMapping(value = "/edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody LightRail lightRail) { public Result<String> edit(@RequestBody LightRail lightRail) {
lightRailService.updateById(lightRail); if (ObjectUtil.isEmpty(lightRail.getId())) {
lightRailService.save(lightRail);
} else {
lightRailService.updateById(lightRail);
}
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
...@@ -97,8 +77,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -97,8 +77,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
*/ */
@AutoLog(value = "线路车站-轻轨线路-通过id删除") @AutoLog(value = "线路车站-轻轨线路-通过id删除")
@ApiOperation(value = "线路车站-轻轨线路-通过id删除", notes = "线路车站-轻轨线路-通过id删除") @ApiOperation(value = "线路车站-轻轨线路-通过id删除", notes = "线路车站-轻轨线路-通过id删除")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:delete") @GetMapping(value = "/delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
lightRailService.removeById(id); lightRailService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
...@@ -112,8 +91,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -112,8 +91,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
*/ */
@AutoLog(value = "线路车站-轻轨线路-批量删除") @AutoLog(value = "线路车站-轻轨线路-批量删除")
@ApiOperation(value = "线路车站-轻轨线路-批量删除", notes = "线路车站-轻轨线路-批量删除") @ApiOperation(value = "线路车站-轻轨线路-批量删除", notes = "线路车站-轻轨线路-批量删除")
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:deleteBatch") @GetMapping(value = "/deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.lightRailService.removeByIds(Arrays.asList(ids.split(","))); this.lightRailService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
...@@ -125,7 +103,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -125,7 +103,7 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
* @param id * @param id
* @return * @return
*/ */
//@AutoLog(value = "线路车站-轻轨线路-通过id查询") @AutoLog(value = "线路车站-轻轨线路-通过id查询")
@ApiOperation(value = "线路车站-轻轨线路-通过id查询", notes = "线路车站-轻轨线路-通过id查询") @ApiOperation(value = "线路车站-轻轨线路-通过id查询", notes = "线路车站-轻轨线路-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<LightRail> queryById(@RequestParam(name = "id", required = true) String id) { public Result<LightRail> queryById(@RequestParam(name = "id", required = true) String id) {
...@@ -136,29 +114,4 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -136,29 +114,4 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
return Result.OK(lightRail); return Result.OK(lightRail);
} }
/**
* 导出excel
*
* @param request
* @param lightRail
*/
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LightRail lightRail) {
return super.exportXls(request, lightRail, LightRail.class, "线路车站-轻轨线路");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
// @RequiresPermissions("subwayNetwork:t_sn_light_rail:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, LightRail.class);
}
} }
package org.jeecg.modules.subwayNetwork.controller;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.subwayNetwork.entity.SectionStationMap;
import org.jeecg.modules.subwayNetwork.service.ISectionStationMapService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 线路车站-区间站点映射
* @Author: jeecg-boot
* @Date: 2023-06-15
* @Version: V1.0
*/
@Api(tags="线路车站-区间站点映射")
@RestController
@RequestMapping("/subwayNetwork/sectionStationMap")
@Slf4j
public class SectionStationMapController extends JeecgController<SectionStationMap, ISectionStationMapService> {
@Autowired
private ISectionStationMapService sectionStationMapService;
/**
* 分页列表查询
*
* @param sectionStationMap
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "线路车站-区间站点映射-分页列表查询")
@ApiOperation(value="线路车站-区间站点映射-分页列表查询", notes="线路车站-区间站点映射-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<SectionStationMap>> queryPageList(SectionStationMap sectionStationMap,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<SectionStationMap> queryWrapper = QueryGenerator.initQueryWrapper(sectionStationMap, req.getParameterMap());
Page<SectionStationMap> page = new Page<SectionStationMap>(pageNo, pageSize);
IPage<SectionStationMap> pageList = sectionStationMapService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param sectionStationMap
* @return
*/
@AutoLog(value = "线路车站-区间站点映射-添加")
@ApiOperation(value="线路车站-区间站点映射-添加", notes="线路车站-区间站点映射-添加")
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody SectionStationMap sectionStationMap) {
sectionStationMapService.save(sectionStationMap);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param sectionStationMap
* @return
*/
@AutoLog(value = "线路车站-区间站点映射-编辑")
@ApiOperation(value="线路车站-区间站点映射-编辑", notes="线路车站-区间站点映射-编辑")
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody SectionStationMap sectionStationMap) {
sectionStationMapService.updateById(sectionStationMap);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "线路车站-区间站点映射-通过id删除")
@ApiOperation(value="线路车站-区间站点映射-通过id删除", notes="线路车站-区间站点映射-通过id删除")
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
sectionStationMapService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "线路车站-区间站点映射-批量删除")
@ApiOperation(value="线路车站-区间站点映射-批量删除", notes="线路车站-区间站点映射-批量删除")
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.sectionStationMapService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "线路车站-区间站点映射-通过id查询")
@ApiOperation(value="线路车站-区间站点映射-通过id查询", notes="线路车站-区间站点映射-通过id查询")
@GetMapping(value = "/queryById")
public Result<SectionStationMap> queryById(@RequestParam(name="id",required=true) String id) {
SectionStationMap sectionStationMap = sectionStationMapService.getById(id);
if(sectionStationMap==null) {
return Result.error("未找到对应数据");
}
return Result.OK(sectionStationMap);
}
/**
* 导出excel
*
* @param request
* @param sectionStationMap
*/
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, SectionStationMap sectionStationMap) {
return super.exportXls(request, sectionStationMap, SectionStationMap.class, "线路车站-区间站点映射");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("subwayNetwork:t_sn_section_station_map:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, SectionStationMap.class);
}
}
...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection; import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
import org.jeecg.modules.subwayNetwork.service.ISubwaySectionService; import org.jeecg.modules.subwayNetwork.service.ISubwaySectionService;
...@@ -37,16 +38,7 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub ...@@ -37,16 +38,7 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub
@Autowired @Autowired
private ISubwaySectionService subwaySectionService; private ISubwaySectionService subwaySectionService;
/** @AutoLog(value = "线路车站-地铁区间-分页列表查询")
* 分页列表查询
*
* @param subwaySection
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "线路车站-地铁区间-分页列表查询")
@ApiOperation(value = "线路车站-地铁区间-分页列表查询", notes = "线路车站-地铁区间-分页列表查询") @ApiOperation(value = "线路车站-地铁区间-分页列表查询", notes = "线路车站-地铁区间-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<SubwaySection>> queryPageList(SubwaySection subwaySection, public Result<IPage<SubwaySection>> queryPageList(SubwaySection subwaySection,
...@@ -59,72 +51,31 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub ...@@ -59,72 +51,31 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 添加
*
* @param subwaySection
* @return
*/
@AutoLog(value = "线路车站-地铁区间-添加")
@ApiOperation(value = "线路车站-地铁区间-添加", notes = "线路车站-地铁区间-添加")
@RequiresPermissions("subwayNetwork:t_sn_subway_section:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody SubwaySection subwaySection) {
subwaySectionService.save(subwaySection);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param subwaySection
* @return
*/
@AutoLog(value = "线路车站-地铁区间-编辑") @AutoLog(value = "线路车站-地铁区间-编辑")
@ApiOperation(value = "线路车站-地铁区间-编辑", notes = "线路车站-地铁区间-编辑") @ApiOperation(value = "线路车站-地铁区间-编辑", notes = "线路车站-地铁区间-编辑")
@RequiresPermissions("subwayNetwork:t_sn_subway_section:edit") @PostMapping(value = "/edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) public Result<String> edit(@RequestBody SubwaySectionEditDTO dto) {
public Result<String> edit(@RequestBody SubwaySection subwaySection) { subwaySectionService.edit(dto);
subwaySectionService.updateById(subwaySection);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "线路车站-地铁区间-通过id删除") @AutoLog(value = "线路车站-地铁区间-通过id删除")
@ApiOperation(value = "线路车站-地铁区间-通过id删除", notes = "线路车站-地铁区间-通过id删除") @ApiOperation(value = "线路车站-地铁区间-通过id删除", notes = "线路车站-地铁区间-通过id删除")
@RequiresPermissions("subwayNetwork:t_sn_subway_section:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
subwaySectionService.removeById(id); subwaySectionService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "线路车站-地铁区间-批量删除") @AutoLog(value = "线路车站-地铁区间-批量删除")
@ApiOperation(value = "线路车站-地铁区间-批量删除", notes = "线路车站-地铁区间-批量删除") @ApiOperation(value = "线路车站-地铁区间-批量删除", notes = "线路车站-地铁区间-批量删除")
@RequiresPermissions("subwayNetwork:t_sn_subway_section:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.subwaySectionService.removeByIds(Arrays.asList(ids.split(","))); this.subwaySectionService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "线路车站-地铁区间-通过id查询") //@AutoLog(value = "线路车站-地铁区间-通过id查询")
@ApiOperation(value = "线路车站-地铁区间-通过id查询", notes = "线路车站-地铁区间-通过id查询") @ApiOperation(value = "线路车站-地铁区间-通过id查询", notes = "线路车站-地铁区间-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
...@@ -136,29 +87,4 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub ...@@ -136,29 +87,4 @@ public class SubwaySectionController extends JeecgController<SubwaySection, ISub
return Result.OK(subwaySection); return Result.OK(subwaySection);
} }
/**
* 导出excel
*
* @param request
* @param subwaySection
*/
@RequiresPermissions("subwayNetwork:t_sn_subway_section:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, SubwaySection subwaySection) {
return super.exportXls(request, subwaySection, SubwaySection.class, "线路车站-地铁区间");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("subwayNetwork:t_sn_subway_section:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, SubwaySection.class);
}
} }
package org.jeecg.modules.subwayNetwork.controller; package org.jeecg.modules.subwayNetwork.controller;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.service.ITrainStationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.subwayNetwork.dto.TrainStationQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.service.ITrainStationService;
import org.jeecg.modules.subwayNetwork.vo.TrainStationVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/** import java.util.Arrays;
/**
* @Description: 线路车站-地铁站 * @Description: 线路车站-地铁站
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="线路车站-地铁站") @Api(tags = "线路车站-地铁站")
@RestController @RestController
@RequestMapping("/subwayNetwork/trainStation") @RequestMapping("/subwayNetwork/trainStation")
@Slf4j @Slf4j
public class TrainStationController extends JeecgController<TrainStation, ITrainStationService> { public class TrainStationController extends JeecgController<TrainStation, ITrainStationService> {
@Autowired @Autowired
private ITrainStationService trainStationService; private ITrainStationService trainStationService;
/**
* 分页列表查询
*
* @param trainStation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "线路车站-地铁站-分页列表查询")
@ApiOperation(value="线路车站-地铁站-分页列表查询", notes="线路车站-地铁站-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<TrainStation>> queryPageList(TrainStation trainStation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<TrainStation> queryWrapper = QueryGenerator.initQueryWrapper(trainStation, req.getParameterMap());
Page<TrainStation> page = new Page<TrainStation>(pageNo, pageSize);
IPage<TrainStation> pageList = trainStationService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param trainStation
* @return
*/
@AutoLog(value = "线路车站-地铁站-添加")
@ApiOperation(value="线路车站-地铁站-添加", notes="线路车站-地铁站-添加")
// @RequiresPermissions("subwayNetwork:t_sn_train_station:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody TrainStation trainStation) {
trainStationService.save(trainStation);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param trainStation
* @return
*/
@AutoLog(value = "线路车站-地铁站-编辑")
@ApiOperation(value="线路车站-地铁站-编辑", notes="线路车站-地铁站-编辑")
// @RequiresPermissions("subwayNetwork:t_sn_train_station:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody TrainStation trainStation) {
trainStationService.updateById(trainStation);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "线路车站-地铁站-通过id删除")
@ApiOperation(value="线路车站-地铁站-通过id删除", notes="线路车站-地铁站-通过id删除")
// @RequiresPermissions("subwayNetwork:t_sn_train_station:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
trainStationService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "线路车站-地铁站-批量删除")
@ApiOperation(value="线路车站-地铁站-批量删除", notes="线路车站-地铁站-批量删除")
// @RequiresPermissions("subwayNetwork:t_sn_train_station:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.trainStationService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "线路车站-地铁站-通过id查询")
@ApiOperation(value="线路车站-地铁站-通过id查询", notes="线路车站-地铁站-通过id查询")
@GetMapping(value = "/queryById")
public Result<TrainStation> queryById(@RequestParam(name="id",required=true) String id) {
TrainStation trainStation = trainStationService.getById(id);
if(trainStation==null) {
return Result.error("未找到对应数据");
}
return Result.OK(trainStation);
}
/** @AutoLog(value = "线路车站-地铁站-分页列表查询")
* 导出excel @ApiOperation(value = "线路车站-地铁站-分页列表查询", notes = "线路车站-地铁站-分页列表查询")
* @GetMapping(value = "/list")
* @param request public Result<IPage<TrainStationVO>> queryPageList(@RequestBody PageSearch<TrainStationQueryDTO> dto) {
* @param trainStation IPage<TrainStationVO> pageList = trainStationService.queryPageList(dto);
*/ return Result.OK(pageList);
// @RequiresPermissions("subwayNetwork:t_sn_train_station:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, TrainStation trainStation) {
return super.exportXls(request, trainStation, TrainStation.class, "线路车站-地铁站");
} }
/** @AutoLog(value = "线路车站-地铁站-添加")
* 通过excel导入数据 @ApiOperation(value = "线路车站-地铁站-添加", notes = "线路车站-地铁站-添加")
* @PostMapping(value = "/add")
* @param request public Result<String> add(@RequestBody TrainStation trainStation) {
* @param response trainStationService.save(trainStation);
* @return return Result.OK("添加成功!");
*/
// @RequiresPermissions("subwayNetwork:t_sn_train_station:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, TrainStation.class);
} }
@AutoLog(value = "线路车站-地铁站-编辑")
@ApiOperation(value = "线路车站-地铁站-编辑", notes = "线路车站-地铁站-编辑")
@PostMapping(value = "/edit")
public Result<String> edit(@RequestBody TrainStation trainStation) {
trainStationService.updateById(trainStation);
return Result.OK("编辑成功!");
}
@AutoLog(value = "线路车站-地铁站-通过id删除")
@ApiOperation(value = "线路车站-地铁站-通过id删除", notes = "线路车站-地铁站-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
trainStationService.removeById(id);
return Result.OK("删除成功!");
}
@AutoLog(value = "线路车站-地铁站-批量删除")
@ApiOperation(value = "线路车站-地铁站-批量删除", notes = "线路车站-地铁站-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.trainStationService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
} }
package org.jeecg.modules.subwayNetwork.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "线路DTO")
public class LightRailQueryDTO {
@ApiModelProperty(value = "线路name")
private String railLineName;
@ApiModelProperty(value = "状态")
private String status;
}
package org.jeecg.modules.subwayNetwork.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@ApiModel(value = "区间DTO")
public class SubwaySectionDTO {
@ApiModelProperty(value = "线路id")
private java.lang.String railId;
}
package org.jeecg.modules.subwayNetwork.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "SubwaySectionEditDTO编辑")
public class SubwaySectionEditDTO {
}
package org.jeecg.modules.subwayNetwork.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel(value = "地铁站DTO")
public class TrainStationQueryDTO {
@ApiModelProperty(value = "车站名")
private String stationName;
}
...@@ -4,10 +4,8 @@ import java.io.Serializable; ...@@ -4,10 +4,8 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
...@@ -21,47 +19,45 @@ import lombok.experimental.Accessors; ...@@ -21,47 +19,45 @@ import lombok.experimental.Accessors;
/** /**
* @Description: 线路车站-轻轨线路 * @Description: 线路车站-轻轨线路
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
@Data @Data
@TableName("t_sn_light_rail") @TableName("t_sn_light_rail")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value="t_sn_light_rail对象", description="线路车站-轻轨线路") @ApiModel(value = "t_sn_light_rail对象", description = "线路车站-轻轨线路")
public class LightRail implements Serializable { public class LightRail implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private java.lang.String id; private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期") @ApiModelProperty(value = "创建日期")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private java.lang.String updateBy; private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期") @ApiModelProperty(value = "更新日期")
private java.util.Date updateTime; private Date updateTime;
/**线路名称*/
@Excel(name = "线路名称", width = 15)
@ApiModelProperty(value = "线路名称") @ApiModelProperty(value = "线路名称")
private java.lang.String railLineName; private String railLineName;
/**线路code*/
@Excel(name = "线路code", width = 15)
@ApiModelProperty(value = "线路code") @ApiModelProperty(value = "线路code")
private java.lang.String railLineCode; private String railLineCode;
/**状态*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private java.lang.String status; private Integer status;
} }
...@@ -53,71 +53,52 @@ public class TrainStation implements Serializable { ...@@ -53,71 +53,52 @@ public class TrainStation implements Serializable {
*/ */
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private String updateBy; private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期") @ApiModelProperty(value = "更新日期")
private Date updateTime; private Date updateTime;
/**
* 轻轨线路ID
*/
@Excel(name = "轻轨线路ID", width = 15) @Excel(name = "轻轨线路ID", width = 15)
@ApiModelProperty(value = "轻轨线路ID") @ApiModelProperty(value = "轻轨线路ID")
private String lightRailId; private String lightRailId;
/**
* 车站名
*/
@Excel(name = "车站名", width = 15) @Excel(name = "车站名", width = 15)
@ApiModelProperty(value = "车站名") @ApiModelProperty(value = "车站名")
private String stationName; private String stationName;
/**
* 车站编码
*/
@Excel(name = "车站编码", width = 15) @Excel(name = "车站编码", width = 15)
@ApiModelProperty(value = "车站编码") @ApiModelProperty(value = "车站编码")
private String stationCode; private String stationCode;
/**
* 线别
*/
@Excel(name = "线别", width = 15) @Excel(name = "线别", width = 15)
@ApiModelProperty(value = "线别") @ApiModelProperty(value = "线别")
private String lineAlias; private String lineAlias;
/**
* 起始里程前缀
*/
@Excel(name = "起始里程前缀", width = 15) @Excel(name = "起始里程前缀", width = 15)
@ApiModelProperty(value = "起始里程前缀") @ApiModelProperty(value = "起始里程前缀")
private String startingMileagePrefix; private String startingMileagePrefix;
/**
* 起始里程
*/
@Excel(name = "起始里程", width = 15) @Excel(name = "起始里程", width = 15)
@ApiModelProperty(value = "起始里程") @ApiModelProperty(value = "起始里程")
private BigDecimal startingMileage; private BigDecimal startingMileage;
/**
* 中心里程前缀
*/
@Excel(name = "中心里程前缀", width = 15) @Excel(name = "中心里程前缀", width = 15)
@ApiModelProperty(value = "中心里程前缀") @ApiModelProperty(value = "中心里程前缀")
private String centerMileagePrefix; private String centerMileagePrefix;
/**
* 中心里程
*/
@Excel(name = "中心里程", width = 15) @Excel(name = "中心里程", width = 15)
@ApiModelProperty(value = "中心里程") @ApiModelProperty(value = "中心里程")
private BigDecimal centerMileage; private BigDecimal centerMileage;
/**
* 结束里程前缀
*/
@Excel(name = "结束里程前缀", width = 15) @Excel(name = "结束里程前缀", width = 15)
@ApiModelProperty(value = "结束里程前缀") @ApiModelProperty(value = "结束里程前缀")
private String endMileagePrefix; private String endMileagePrefix;
/**
* 结束里程
*/
@Excel(name = "结束里程", width = 15) @Excel(name = "结束里程", width = 15)
@ApiModelProperty(value = "结束里程") @ApiModelProperty(value = "结束里程")
private BigDecimal endMileage; private BigDecimal endMileage;
@ApiModelProperty(value = "序号")
private Integer seq;
} }
package org.jeecg.modules.subwayNetwork.mapper; package org.jeecg.modules.subwayNetwork.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
/** /**
* @Description: 线路车站-轻轨线路 * @Description: 线路车站-轻轨线路
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
public interface LightRailMapper extends BaseMapper<LightRail> { public interface LightRailMapper extends BaseMapper<LightRail> {
IPage<LightRailQueryVO> queryPageList(IPage<LightRailQueryVO> page, LightRailQueryDTO query);
} }
package org.jeecg.modules.subwayNetwork.mapper; package org.jeecg.modules.subwayNetwork.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.subwayNetwork.dto.TrainStationQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.TrainStation; import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
import org.jeecg.modules.subwayNetwork.vo.TrainStationVO;
/** /**
* @Description: 线路车站-地铁站 * @Description: 线路车站-地铁站
...@@ -11,4 +15,5 @@ import org.jeecg.modules.subwayNetwork.entity.TrainStation; ...@@ -11,4 +15,5 @@ import org.jeecg.modules.subwayNetwork.entity.TrainStation;
*/ */
public interface TrainStationMapper extends BaseMapper<TrainStation> { public interface TrainStationMapper extends BaseMapper<TrainStation> {
IPage<TrainStationVO> queryPageList(IPage<LightRailQueryVO> page, TrainStationQueryDTO query);
} }
...@@ -2,4 +2,32 @@ ...@@ -2,4 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.subwayNetwork.mapper.LightRailMapper"> <mapper namespace="org.jeecg.modules.subwayNetwork.mapper.LightRailMapper">
<select id="queryPageList" resultType="org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO">
SELECT
t1.create_by,
t1.create_time,
t1.id,
t1.rail_line_code,
t1.rail_line_name,
t1.status,
t1.update_by,
t1.update_time,
count(t2.id) subwaySectionNum,
count(t3.id) trainStationNum,
ifnull(sum(t3.end_mileage),0) lineMileage
FROM
t_sn_light_rail t1
LEFT JOIN t_sn_subway_section t2 ON t1.id = t2.rail_id
LEFT JOIN t_sn_train_station t3 ON t1.id = t3.light_rail_id
<where>
<if test="query.railLineName != null and query.railLineName != ''">
AND t1.rail_line_name like concat('%',#{query.railLineName},'%')
</if>
<if test="query.status != null and query.status != ''">
AND t1.status = #{query.status}
</if>
</where>
GROUP BY t1.id
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,4 +2,44 @@ ...@@ -2,4 +2,44 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.subwayNetwork.mapper.TrainStationMapper"> <mapper namespace="org.jeecg.modules.subwayNetwork.mapper.TrainStationMapper">
<select id="queryPageList" resultType="org.jeecg.modules.subwayNetwork.vo.TrainStationVO">
SELECT
t1.center_mileage,
t1.center_mileage_prefix,
t1.create_by,
t1.create_time,
t1.end_mileage,
t1.end_mileage_prefix,
t1.id,
t1.light_rail_id,
t1.line_alias,
t1.starting_mileage,
t1.starting_mileage_prefix,
t1.station_code,
t1.station_name,
t1.update_by,
t1.update_time,
t1.center_mileage,
t1.center_mileage_prefix,
t1.create_by,
t1.create_time,
t1.end_mileage,
t1.end_mileage_prefix,
t1.id,
t1.light_rail_id,
t1.line_alias,
t1.starting_mileage,
t1.starting_mileage_prefix,
t1.station_code,
t1.station_name,
t1.update_by,
t1.update_time
FROM
t_sn_train_station t1
<where>
<if test="query.stationName !=null and query.stationName!=''">
AND t1.station_name like concat('%',#{query.stationName},'%')
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
package org.jeecg.modules.subwayNetwork.service; package org.jeecg.modules.subwayNetwork.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
/** /**
* @Description: 线路车站-轻轨线路 * @Description: 线路车站-轻轨线路
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
public interface ILightRailService extends IService<LightRail> { public interface ILightRailService extends IService<LightRail> {
/**
* 分页查询
*
* @param dto
* @return
*/
IPage<LightRailQueryVO> queryPageList(PageSearch<LightRailQueryDTO> dto);
} }
package org.jeecg.modules.subwayNetwork.service; package org.jeecg.modules.subwayNetwork.service;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection; import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -11,4 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -11,4 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISubwaySectionService extends IService<SubwaySection> { public interface ISubwaySectionService extends IService<SubwaySection> {
void edit(SubwaySectionEditDTO dto);
} }
package org.jeecg.modules.subwayNetwork.service; package org.jeecg.modules.subwayNetwork.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.subwayNetwork.dto.TrainStationQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.TrainStation; import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.vo.TrainStationVO;
/** /**
* @Description: 线路车站-地铁站 * @Description: 线路车站-地铁站
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
public interface ITrainStationService extends IService<TrainStation> { public interface ITrainStationService extends IService<TrainStation> {
IPage<TrainStationVO> queryPageList(PageSearch<TrainStationQueryDTO> dto);
} }
package org.jeecg.modules.subwayNetwork.service.impl; package org.jeecg.modules.subwayNetwork.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.subwayNetwork.dto.LightRailQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.entity.SectionStationMap;
import org.jeecg.modules.subwayNetwork.mapper.LightRailMapper; import org.jeecg.modules.subwayNetwork.mapper.LightRailMapper;
import org.jeecg.modules.subwayNetwork.service.ILightRailService; import org.jeecg.modules.subwayNetwork.service.ILightRailService;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
* @Description: 线路车站-轻轨线路 * @Description: 线路车站-轻轨线路
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-06-14 * @Date: 2023-06-14
* @Version: V1.0 * @Version: V1.0
*/ */
@Service @Service
public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail> implements ILightRailService { public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail> implements ILightRailService {
@Override
public IPage<LightRailQueryVO> queryPageList(PageSearch<LightRailQueryDTO> dto) {
IPage<LightRailQueryVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
page = this.baseMapper.queryPageList(page, dto.getQuery());
return page;
}
} }
package org.jeecg.modules.subwayNetwork.service.impl; package org.jeecg.modules.subwayNetwork.service.impl;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection; import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
import org.jeecg.modules.subwayNetwork.mapper.SubwaySectionMapper; import org.jeecg.modules.subwayNetwork.mapper.SubwaySectionMapper;
import org.jeecg.modules.subwayNetwork.service.ISubwaySectionService; import org.jeecg.modules.subwayNetwork.service.ISubwaySectionService;
...@@ -16,4 +17,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -16,4 +17,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, SubwaySection> implements ISubwaySectionService { public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, SubwaySection> implements ISubwaySectionService {
@Override
public void edit(SubwaySectionEditDTO dto) {
}
} }
package org.jeecg.modules.subwayNetwork.service.impl; package org.jeecg.modules.subwayNetwork.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.modules.subwayNetwork.dto.TrainStationQueryDTO;
import org.jeecg.modules.subwayNetwork.mapper.TrainStationMapper; import org.jeecg.modules.subwayNetwork.mapper.TrainStationMapper;
import org.jeecg.modules.subwayNetwork.service.ITrainStationService; import org.jeecg.modules.subwayNetwork.service.ITrainStationService;
import org.jeecg.modules.subwayNetwork.entity.TrainStation; import org.jeecg.modules.subwayNetwork.entity.TrainStation;
import org.jeecg.modules.subwayNetwork.vo.LightRailQueryVO;
import org.jeecg.modules.subwayNetwork.vo.TrainStationVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -15,4 +21,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -15,4 +21,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class TrainStationServiceImpl extends ServiceImpl<TrainStationMapper, TrainStation> implements ITrainStationService { public class TrainStationServiceImpl extends ServiceImpl<TrainStationMapper, TrainStation> implements ITrainStationService {
@Override
public IPage<TrainStationVO> queryPageList(PageSearch<TrainStationQueryDTO> dto) {
IPage<LightRailQueryVO> page = new Page<>(dto.getPageNo(), dto.getPageSize());
return this.baseMapper.queryPageList(page,dto.getQuery());
}
} }
package org.jeecg.modules.subwayNetwork.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel(value = "线路VO")
public class LightRailQueryVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "创建人")
private String createBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
@ApiModelProperty(value = "线路名称")
private java.lang.String railLineName;
@ApiModelProperty(value = "线路code")
private java.lang.String railLineCode;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "区间数量")
private Integer subwaySectionNum;
@ApiModelProperty(value = "车站数量")
private Integer trainStationNum;
@ApiModelProperty(value = "线路里程")
private BigDecimal lineMileage;
}
package org.jeecg.modules.subwayNetwork.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "区间VO")
public class SubwaySectionVO {
}
package org.jeecg.modules.subwayNetwork.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel(value = "地铁站VO")
public class TrainStationVO {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "创建人")
private String createBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
@ApiModelProperty(value = "更新人")
private String updateBy;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
@ApiModelProperty(value = "轻轨线路ID")
private String lightRailId;
@ApiModelProperty(value = "车站名")
private String stationName;
@ApiModelProperty(value = "车站编码")
private String stationCode;
@ApiModelProperty(value = "线别")
private String lineAlias;
@ApiModelProperty(value = "起始里程前缀")
private String startingMileagePrefix;
@ApiModelProperty(value = "起始里程")
private BigDecimal startingMileage;
@ApiModelProperty(value = "中心里程前缀")
private String centerMileagePrefix;
@ApiModelProperty(value = "中心里程")
private BigDecimal centerMileage;
@ApiModelProperty(value = "结束里程前缀")
private String endMileagePrefix;
@ApiModelProperty(value = "结束里程")
private BigDecimal endMileage;
}
...@@ -131,7 +131,7 @@ spring: ...@@ -131,7 +131,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/hzsomms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://47.94.207.62:3306/hzsomms2?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username: root username: root
password: superAdmin&321 password: superAdmin&321
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
...@@ -144,7 +144,7 @@ spring: ...@@ -144,7 +144,7 @@ spring:
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: 47.94.207.62
lettuce: lettuce:
pool: pool:
max-active: 8 #最大连接数据库连接数,设 0 为没有限制 max-active: 8 #最大连接数据库连接数,设 0 为没有限制
......
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