diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java b/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java new file mode 100644 index 00000000..2f7f759d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadSectionController.java @@ -0,0 +1,109 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcRoadSection; +import com.zc.business.service.IDcRoadSectionService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 辖区路段Controller + * + * @author ruoyi + * @date 2024-01-11 + */ +@RestController +@RequestMapping("/business/roadSection") +public class DcRoadSectionController extends BaseController +{ + @Autowired + private IDcRoadSectionService dcRoadSectionService; + + /** + * 查询辖区路段列表 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:list')") + @GetMapping("/list") + public TableDataInfo list(DcRoadSection dcRoadSection) + { + startPage(); + List list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection); + return getDataTable(list); + } + + /** + * 导出辖区路段列表 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:export')") + @Log(title = "辖区路段", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcRoadSection dcRoadSection) + { + List list = dcRoadSectionService.selectDcRoadSectionList(dcRoadSection); + ExcelUtil util = new ExcelUtil<>(DcRoadSection.class); + util.exportExcel(response, list, "辖区路段数据"); + } + + /** + * 获取辖区路段详细信息 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcRoadSectionService.selectDcRoadSectionById(id)); + } + + /** + * 新增辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:add')") + @Log(title = "辖区路段", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcRoadSection dcRoadSection) + { + return toAjax(dcRoadSectionService.insertDcRoadSection(dcRoadSection)); + } + + /** + * 修改辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:edit')") + @Log(title = "辖区路段", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcRoadSection dcRoadSection) + { + return toAjax(dcRoadSectionService.updateDcRoadSection(dcRoadSection)); + } + + /** + * 删除辖区路段 + */ + @PreAuthorize("@ss.hasPermi('business:roadSection:remove')") + @Log(title = "辖区路段", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcRoadSectionService.deleteDcRoadSectionByIds(ids)); + } + //查询路线id与名称 + @PostMapping("/roadList") + public AjaxResult roadList(){ + return AjaxResult.success(dcRoadSectionService.selectRoadList()); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java b/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java index 82a66de0..fa621c9b 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcOrganization.java @@ -41,8 +41,19 @@ public class DcOrganization extends TreeEntity /** 描述 */ @Excel(name = "描述") private String description; + /** 方向 */ + @Excel(name = "方向") + private String direction; - public void setId(Long id) + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public void setId(Long id) { this.id = id; } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java new file mode 100644 index 00000000..50077904 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcRoadSection.java @@ -0,0 +1,159 @@ +package com.zc.business.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 辖区路段对象 dc_road_section + * + * @author ruoyi + * @date 2024-01-11 + */ +public class DcRoadSection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 所属部门 */ + @Excel(name = "所属部门") + private Long deptId; + + /** 所属路线 */ + @Excel(name = "所属路线") + private Long roadId; + + /** 开始桩号 */ + @Excel(name = "开始桩号") + private String startStakeMark; + + /** 结束桩号 */ + @Excel(name = "结束桩号") + private String endStakeMark; + + /** 辖区路线名称 */ + @Excel(name = "辖区路线名称") + private String sectionName; + + /** 辖区路线编号 */ + @Excel(name = "辖区路线编号") + private String roadCode; + + /** 里程 */ + @Excel(name = "里程") + private String mileage; + /** 部门名称 */ + @Excel(name = "部门名称") + private String deptName; + /** 道路名称 */ + @Excel(name = "道路名称") + private String roadName; + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getRoadName() { + return roadName; + } + + public void setRoadName(String roadName) { + this.roadName = roadName; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public void setRoadId(Long roadId) + { + this.roadId = roadId; + } + + public Long getRoadId() + { + return roadId; + } + public void setStartStakeMark(String startStakeMark) + { + this.startStakeMark = startStakeMark; + } + + public String getStartStakeMark() + { + return startStakeMark; + } + public void setEndStakeMark(String endStakeMark) + { + this.endStakeMark = endStakeMark; + } + + public String getEndStakeMark() + { + return endStakeMark; + } + public void setSectionName(String sectionName) + { + this.sectionName = sectionName; + } + + public String getSectionName() + { + return sectionName; + } + public void setRoadCode(String roadCode) + { + this.roadCode = roadCode; + } + + public String getRoadCode() + { + return roadCode; + } + public void setMileage(String mileage) + { + this.mileage = mileage; + } + + public String getMileage() + { + return mileage; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("deptId", getDeptId()) + .append("roadId", getRoadId()) + .append("startStakeMark", getStartStakeMark()) + .append("endStakeMark", getEndStakeMark()) + .append("sectionName", getSectionName()) + .append("roadCode", getRoadCode()) + .append("mileage", getMileage()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java new file mode 100644 index 00000000..02913bcb --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcRoadSectionMapper.java @@ -0,0 +1,64 @@ +package com.zc.business.mapper; + +import java.util.HashMap; +import java.util.List; +import com.zc.business.domain.DcRoadSection; + +/** + * 辖区路段Mapper接口 + * + * @author ruoyi + * @date 2024-01-11 + */ +public interface DcRoadSectionMapper +{ + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + public DcRoadSection selectDcRoadSectionById(Long id); + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段集合 + */ + List selectDcRoadSectionList(DcRoadSection dcRoadSection); + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int insertDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int updateDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 删除辖区路段 + * + * @param id 辖区路段主键 + * @return 结果 + */ + int deleteDcRoadSectionById(Long id); + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcRoadSectionByIds(Long[] ids); + //查询路线id与名称 + List> selectRoadList(); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java b/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java new file mode 100644 index 00000000..8a7d8b7e --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadSectionService.java @@ -0,0 +1,64 @@ +package com.zc.business.service; + +import java.util.HashMap; +import java.util.List; +import com.zc.business.domain.DcRoadSection; + +/** + * 辖区路段Service接口 + * + * @author ruoyi + * @date 2024-01-11 + */ +public interface IDcRoadSectionService +{ + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + public DcRoadSection selectDcRoadSectionById(Long id); + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段集合 + */ + List selectDcRoadSectionList(DcRoadSection dcRoadSection); + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int insertDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + int updateDcRoadSection(DcRoadSection dcRoadSection); + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的辖区路段主键集合 + * @return 结果 + */ + int deleteDcRoadSectionByIds(Long[] ids); + + /** + * 删除辖区路段信息 + * + * @param id 辖区路段主键 + * @return 结果 + */ + int deleteDcRoadSectionById(Long id); + //查询路线id与名称 + List> selectRoadList(); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java new file mode 100644 index 00000000..dd88fa91 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadSectionServiceImpl.java @@ -0,0 +1,102 @@ +package com.zc.business.service.impl; + +import java.util.HashMap; +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zc.business.mapper.DcRoadSectionMapper; +import com.zc.business.domain.DcRoadSection; +import com.zc.business.service.IDcRoadSectionService; + +/** + * 辖区路段Service业务层处理 + * + * @author ruoyi + * @date 2024-01-11 + */ +@Service +public class DcRoadSectionServiceImpl implements IDcRoadSectionService +{ + @Autowired + private DcRoadSectionMapper dcRoadSectionMapper; + + /** + * 查询辖区路段 + * + * @param id 辖区路段主键 + * @return 辖区路段 + */ + @Override + public DcRoadSection selectDcRoadSectionById(Long id) + { + return dcRoadSectionMapper.selectDcRoadSectionById(id); + } + + /** + * 查询辖区路段列表 + * + * @param dcRoadSection 辖区路段 + * @return 辖区路段 + */ + @Override + public List selectDcRoadSectionList(DcRoadSection dcRoadSection) + { + return dcRoadSectionMapper.selectDcRoadSectionList(dcRoadSection); + } + + /** + * 新增辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + @Override + public int insertDcRoadSection(DcRoadSection dcRoadSection) + { + dcRoadSection.setCreateTime(DateUtils.getNowDate()); + return dcRoadSectionMapper.insertDcRoadSection(dcRoadSection); + } + + /** + * 修改辖区路段 + * + * @param dcRoadSection 辖区路段 + * @return 结果 + */ + @Override + public int updateDcRoadSection(DcRoadSection dcRoadSection) + { + dcRoadSection.setUpdateTime(DateUtils.getNowDate()); + return dcRoadSectionMapper.updateDcRoadSection(dcRoadSection); + } + + /** + * 批量删除辖区路段 + * + * @param ids 需要删除的辖区路段主键 + * @return 结果 + */ + @Override + public int deleteDcRoadSectionByIds(Long[] ids) + { + return dcRoadSectionMapper.deleteDcRoadSectionByIds(ids); + } + + /** + * 删除辖区路段信息 + * + * @param id 辖区路段主键 + * @return 结果 + */ + @Override + public int deleteDcRoadSectionById(Long id) + { + return dcRoadSectionMapper.deleteDcRoadSectionById(id); + } + //查询路线id与名称 + @Override + public List> selectRoadList() { + return dcRoadSectionMapper.selectRoadList(); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml index 083f1e00..5a627cb7 100644 --- a/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcOrganizationMapper.xml @@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization + select id,direction, parent_id, organization_type, organization_name, organization_address, stake_mark_id, rescue_unit, description, create_time, update_time from dc_organization + + + and section.dept_id = #{deptId} + and section.road_id = #{roadId} + and section.start_stake_mark = #{startStakeMark} + and section.end_stake_mark = #{endStakeMark} + and section.section_name like concat('%', #{sectionName}, '%') + and section.road_code = #{roadCode} + + + + + + + + insert into dc_road_section + + id, + dept_id, + road_id, + start_stake_mark, + end_stake_mark, + section_name, + road_code, + mileage, + create_time, + update_time, + + + #{id}, + #{deptId}, + #{roadId}, + #{startStakeMark}, + #{endStakeMark}, + #{sectionName}, + #{roadCode}, + #{mileage}, + #{createTime}, + #{updateTime}, + + + + + update dc_road_section + + dept_id = #{deptId}, + road_id = #{roadId}, + start_stake_mark = #{startStakeMark}, + end_stake_mark = #{endStakeMark}, + section_name = #{sectionName}, + road_code = #{roadCode}, + mileage = #{mileage}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from dc_road_section where id = #{id} + + + + delete from dc_road_section where id in + + #{id} + + + \ No newline at end of file