Merge remote-tracking branch 'origin/youxilong_2.26_院后第一增量' into youxilong_2.26_院后第一增量

This commit is contained in:
youxilong 2024-02-28 13:19:08 +08:00
commit 902e8e40dd
39 changed files with 2153 additions and 296 deletions

View File

@ -134,8 +134,23 @@ public class Constants {
public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.xinelu.common.utils.file"};
/**
* Excel文件格式后缀
*/
public static final String XLSX = "xlsx";
/**
* Excel文件格式后缀
*/
public static final String XLS = "xls";
/**
* 机构类别编码前缀
*/
public static final String CATEGORY_CODE = "CC";
/**
* 机构信息导入标识
*/
public static final String AGENCY = "agency";
}

View File

@ -0,0 +1,63 @@
package com.xinelu.common.utils.regex;
import com.xinelu.common.exception.ServiceException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import java.util.regex.Pattern;
/**
* @Description 正则表达式工具类
* @Author 纪寒
* @Date 2022-08-24 13:58:48
* @Version 1.0
*/
@Component
public class RegexUtil {
/**
* 校验手机号码
*
* @param phone 手机号码
* @return 校验结果
*/
public boolean regexPhone(String phone) {
if (StringUtils.isBlank(phone)) {
throw new ServiceException("手机号码不能为空!");
}
//校验手机号
String regex = "^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[2567]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\\d{8})$";
return Pattern.matches(regex, phone);
}
/**
* 校验身份证号码
*
* @param cardNo 身份证号码
* @return 校验结果
*/
public boolean regexCardNo(String cardNo) {
if (StringUtils.isBlank(cardNo)) {
throw new ServiceException("身份证号不能为空!");
}
//校验身份证号码
String regex = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
return Pattern.matches(regex, cardNo);
}
/**
* 校验座机手机号码
*
* @param seatNumber 座机手机号码
* @return 校验结果
*/
public boolean regexSeatNumber(String seatNumber) {
if (StringUtils.isBlank(seatNumber)) {
throw new ServiceException("手机号码不能为空!");
}
//校验座机手机号
String regex = "^(([0-9]{4,13}))";
return Pattern.matches(regex, seatNumber);
}
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.controller.agency;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
@ -8,12 +9,15 @@ import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.service.agency.IAgencyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Objects;
/**
* 机构信息Controller
@ -86,7 +90,7 @@ public class AgencyController extends BaseController {
@Log(title = "机构信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(agencyService.deleteAgencyByIds(ids));
return agencyService.deleteAgencyByIds(ids);
}
/**
@ -96,4 +100,29 @@ public class AgencyController extends BaseController {
public AjaxResult agencyList() {
return AjaxResult.success(agencyService.agencyList());
}
/**
* 导入机构信息
*
* @param file 模板文件
* @return 导入结果
* @throws Exception 异常信息
*/
@PreAuthorize("@ss.hasPermi('system:agency:importStationInfo')")
@Log(title = "导入机构信息", businessType = BusinessType.IMPORT)
@PostMapping("/insertAgencyImportList")
public AjaxResult insertAgencyImportList(MultipartFile file) throws Exception {
//判断excel里面是否有数据/文件格式
if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) {
return AjaxResult.error("请选择需要导入的文件!");
}
// 获取文件名
String orgName = file.getOriginalFilename();
if (!orgName.endsWith(Constants.XLSX) && !orgName.endsWith(Constants.XLS)) {
return AjaxResult.error("导入文件格式不正确请导入xlsx或xls格式的文件");
}
ExcelUtil<Agency> util = new ExcelUtil<>(Agency.class);
List<Agency> list = util.importExcel(file.getInputStream());
return agencyService.insertAgencyImportList(list);
}
}

View File

@ -65,7 +65,7 @@ public class AgencyCategoryController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:agencyCategory:add')")
@Log(title = "机构类别", businessType = BusinessType.INSERT)
@PostMapping
@PostMapping("/add")
public AjaxResult add(@RequestBody AgencyCategory agencyCategory) {
if (Objects.isNull(agencyCategory)) {
return AjaxResult.success();
@ -78,7 +78,7 @@ public class AgencyCategoryController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:agencyCategory:edit')")
@Log(title = "机构类别", businessType = BusinessType.UPDATE)
@PutMapping
@PutMapping("/edit")
public AjaxResult edit(@RequestBody AgencyCategory agencyCategory) {
return toAjax(agencyCategoryService.updateAgencyCategory(agencyCategory));
}

View File

@ -70,7 +70,7 @@ public class DepartmentController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:department:add')")
@Log(title = "科室信息", businessType = BusinessType.INSERT)
@PostMapping
@PostMapping("/add")
public AjaxResult add(@RequestBody Department department) {
return toAjax(departmentService.insertDepartment(department));
}
@ -80,7 +80,7 @@ public class DepartmentController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:department:edit')")
@Log(title = "科室信息", businessType = BusinessType.UPDATE)
@PutMapping
@PutMapping("/edit")
public AjaxResult edit(@RequestBody Department department) {
return toAjax(departmentService.updateDepartment(department));
}

View File

@ -64,7 +64,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:departmentDisease:add')")
@Log(title = "科室病种信息", businessType = BusinessType.INSERT)
@PostMapping
@PostMapping("/add")
public AjaxResult add(@RequestBody DepartmentDiseaseType departmentDiseaseType) {
return toAjax(departmentDiseaseTypeService.insertDepartmentDiseaseType(departmentDiseaseType));
}
@ -74,7 +74,7 @@ public class DepartmentDiseaseTypeController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('system:departmentDisease:edit')")
@Log(title = "科室病种信息", businessType = BusinessType.UPDATE)
@PutMapping
@PutMapping("/edit")
public AjaxResult edit(@RequestBody DepartmentDiseaseType departmentDiseaseType) {
return toAjax(departmentDiseaseTypeService.updateDepartmentDiseaseType(departmentDiseaseType));
}

View File

@ -0,0 +1,56 @@
package com.xinelu.manage.controller.importdownload;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Objects;
/**
* 导入与下载Controller
*
* @author zh
* @date 2024-02-26
*/
@RestController
@RequestMapping("/system/importDownload")
public class ImportDownloadController {
/**
* 下载导入模板
*
* @param fileType 文件类型
* @param res http请求
**/
@RequestMapping("downloadTemplate")
public void download(@RequestParam(value = "fileType") String fileType, HttpServletResponse res) throws IOException {
if (StringUtils.isBlank(fileType)) {
throw new ServiceException("请选择文件类型!");
}
File file = null;
if (fileType.equals(Constants.AGENCY)) {
file = ResourceUtils.getFile("classpath:template/机构信息导入表.xlsx");
}
if (Objects.isNull(file)) {
throw new ServiceException("下载导入模板文件失败,请联系管理员!");
}
res.setCharacterEncoding("UTF-8");
res.setHeader("Content-Disposition", "inline;filename=" + fileType + ".txt");
res.setContentType("text/plain;UTF-8");
ServletOutputStream os = res.getOutputStream();
byte[] bytes = FileUtils.readFileToByteArray(file);
os.write(bytes);
os.flush();
os.close();
}
}

View File

@ -0,0 +1,91 @@
package com.xinelu.manage.controller.questioninfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 问卷基本信息Controller
*
* @author xinelu
* @date 2024-02-28
*/
@RestController
@RequestMapping("/system/question")
public class QuestionInfoController extends BaseController {
@Resource
private IQuestionInfoService questionInfoService;
/**
* 查询问卷基本信息列表
*/
@PreAuthorize("@ss.hasPermi('system:question:list')")
@GetMapping("/list")
public TableDataInfo list(QuestionInfo questionInfo) {
startPage();
List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
return getDataTable(list);
}
/**
* 导出问卷基本信息列表
*/
@PreAuthorize("@ss.hasPermi('system:question:export')")
@Log(title = "问卷基本信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QuestionInfo questionInfo) {
List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
util.exportExcel(response, list, "问卷基本信息数据");
}
/**
* 获取问卷基本信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:question:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(questionInfoService.selectQuestionInfoById(id));
}
/**
* 新增问卷基本信息
*/
@PreAuthorize("@ss.hasPermi('system:question:add')")
@Log(title = "问卷基本信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QuestionInfo questionInfo) {
return toAjax(questionInfoService.insertQuestionInfo(questionInfo));
}
/**
* 修改问卷基本信息
*/
@PreAuthorize("@ss.hasPermi('system:question:edit')")
@Log(title = "问卷基本信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QuestionInfo questionInfo) {
return toAjax(questionInfoService.updateQuestionInfo(questionInfo));
}
/**
* 删除问卷基本信息
*/
@PreAuthorize("@ss.hasPermi('system:question:remove')")
@Log(title = "问卷基本信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(questionInfoService.deleteQuestionInfoByIds(ids));
}
}

View File

@ -0,0 +1,91 @@
package com.xinelu.manage.controller.subdivisioncategory;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory;
import com.xinelu.manage.service.subdivisioncategory.ISubdivisionCategoryService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 细分类别信息Controller
*
* @author xinelu
* @date 2024-02-28
*/
@RestController
@RequestMapping("/system/subdivision")
public class SubdivisionCategoryController extends BaseController {
@Resource
private ISubdivisionCategoryService subdivisionCategoryService;
/**
* 查询细分类别信息列表
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:list')")
@GetMapping("/list")
public TableDataInfo list(SubdivisionCategory subdivisionCategory) {
startPage();
List<SubdivisionCategory> list = subdivisionCategoryService.selectSubdivisionCategoryList(subdivisionCategory);
return getDataTable(list);
}
/**
* 导出细分类别信息列表
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:export')")
@Log(title = "细分类别信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SubdivisionCategory subdivisionCategory) {
List<SubdivisionCategory> list = subdivisionCategoryService.selectSubdivisionCategoryList(subdivisionCategory);
ExcelUtil<SubdivisionCategory> util = new ExcelUtil<SubdivisionCategory>(SubdivisionCategory.class);
util.exportExcel(response, list, "细分类别信息数据");
}
/**
* 获取细分类别信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(subdivisionCategoryService.selectSubdivisionCategoryById(id));
}
/**
* 新增细分类别信息
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:add')")
@Log(title = "细分类别信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SubdivisionCategory subdivisionCategory) {
return toAjax(subdivisionCategoryService.insertSubdivisionCategory(subdivisionCategory));
}
/**
* 修改细分类别信息
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:edit')")
@Log(title = "细分类别信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SubdivisionCategory subdivisionCategory) {
return toAjax(subdivisionCategoryService.updateSubdivisionCategory(subdivisionCategory));
}
/**
* 删除细分类别信息
*/
@PreAuthorize("@ss.hasPermi('system:subdivision:remove')")
@Log(title = "细分类别信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(subdivisionCategoryService.deleteSubdivisionCategoryByIds(ids));
}
}

View File

@ -11,9 +11,6 @@ import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.List;
/**
* 机构信息对象 agency
*
@ -37,14 +34,14 @@ public class Agency extends BaseEntity {
* 上级机构id
*/
@ApiModelProperty(value = "上级机构id")
@Excel(name = "上级机构id")
@Excel(name = "上级机构")
private Long parentId;
/**
* 所属机构类别id
*/
@ApiModelProperty(value = "所属机构类别id")
@Excel(name = "所属机构类别id")
@Excel(name = "所属机构类别")
private Long agencyCategoryId;
/**
@ -100,7 +97,7 @@ public class Agency extends BaseEntity {
* 节点类型节点类型卫健委HEALTH_COMMISSION医保局MEDICAL_INSURANCE_BUREAU医院HOSPITAL院区CAMPUS药店PHARMACY科室DEPARTMENT病区WARD中国CHINA省份PROVINCE
*/
@ApiModelProperty(value = "节点类型节点类型卫健委HEALTH_COMMISSION医保局MEDICAL_INSURANCE_BUREAU医院HOSPITAL院区CAMPUS药店PHARMACY科室DEPARTMENT病区WARD中国CHINA省份PROVINCE")
@Excel(name = "节点类型节点类型卫健委HEALTH_COMMISSION医保局MEDICAL_INSURANCE_BUREAU医院HOSPITAL院区CAMPUS药店PHARMACY科室DEPARTMENT病区WARD中国CHINA省份PROVINCE")
@Excel(name = "节点类型")
private String nodeType;
/**
@ -114,7 +111,7 @@ public class Agency extends BaseEntity {
* 机构分类管理类别非营利性医疗机构NON_PROFIT_MEDICAL_AGENCY营利性医疗机构FOR_PROFIT_MEDICAL_AGENCY其他卫生机构OTHER_HEALTH_AGENCY
*/
@ApiModelProperty(value = "机构分类管理类别非营利性医疗机构NON_PROFIT_MEDICAL_AGENCY营利性医疗机构FOR_PROFIT_MEDICAL_AGENCY其他卫生机构OTHER_HEALTH_AGENCY")
@Excel(name = "机构分类管理类别非营利性医疗机构NON_PROFIT_MEDICAL_AGENCY营利性医疗机构FOR_PROFIT_MEDICAL_AGENCY其他卫生机构OTHER_HEALTH_AGENCY")
@Excel(name = "机构分类管理类别")
private String agencyCategoryManageLevel;
/**
@ -152,17 +149,6 @@ public class Agency extends BaseEntity {
@Excel(name = "机构排序")
private Integer agencySort;
private List<Agency> children = new ArrayList<Agency>();
public List<Agency> getChildren() {
return children;
}
public void setChildren(List<Agency> children) {
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -11,9 +11,6 @@ import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.List;
/**
* 机构类别对象 agency_category
*
@ -75,18 +72,6 @@ public class AgencyCategory extends BaseEntity {
@Excel(name = "类别概述")
private String categoryRemark;
private List<AgencyCategory> children = new ArrayList<AgencyCategory>();
public List<AgencyCategory> getChildren() {
return children;
}
public void setChildren(List<AgencyCategory> children) {
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,150 @@
package com.xinelu.manage.domain.questioninfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 问卷基本信息对象 question_info
*
* @author xinelu
* @date 2024-02-28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "问卷基本信息对象", description = "question_info")
public class QuestionInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* 所属科室id
*/
@ApiModelProperty(value = "所属科室id")
@Excel(name = "所属科室id")
private Long departmentId;
/**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称")
@Excel(name = "所属科室名称")
private String departmentName;
/**
* 病种id
*/
@ApiModelProperty(value = "病种id")
@Excel(name = "病种id")
private Long diseaseTypeId;
/**
* 病种名称
*/
@ApiModelProperty(value = "病种名称")
@Excel(name = "病种名称")
private String diseaseTypeName;
/**
* 问卷标题
*/
@ApiModelProperty(value = "问卷标题")
@Excel(name = "问卷标题")
private String questionnaireName;
/**
* 问卷说明
*/
@ApiModelProperty(value = "问卷说明")
@Excel(name = "问卷说明")
private String questionnaireDescription;
/**
* 作答方式一页一题ONE_PAGE_ONE_QUESTION非一页一题NOT_ONE_PAGE_ONE_QUESTION
*/
@ApiModelProperty(value = "作答方式一页一题ONE_PAGE_ONE_QUESTION非一页一题NOT_ONE_PAGE_ONE_QUESTION")
@Excel(name = "作答方式一页一题ONE_PAGE_ONE_QUESTION非一页一题NOT_ONE_PAGE_ONE_QUESTION")
private String answeringMethod;
/**
* 问卷ID
*/
@ApiModelProperty(value = "问卷ID")
@Excel(name = "问卷ID")
private String questionnaireId;
/**
* 问题个数
*/
@ApiModelProperty(value = "问题个数")
@Excel(name = "问题个数")
private Integer questionCount;
/**
* 问卷总分值小数点后两位
*/
@ApiModelProperty(value = "问卷总分值,小数点后两位")
@Excel(name = "问卷总分值,小数点后两位")
private BigDecimal questionnaireTotalScore;
/**
* 问卷状态已发布PUBLISHED未发布UNPUBLISHED
*/
@ApiModelProperty(value = "问卷状态已发布PUBLISHED未发布UNPUBLISHED")
@Excel(name = "问卷状态已发布PUBLISHED未发布UNPUBLISHED")
private String questionnaireStatus;
/**
* 问卷排序
*/
@ApiModelProperty(value = "问卷排序")
@Excel(name = "问卷排序")
private Integer questionnaireSort;
/**
* 问卷备注信息
*/
@ApiModelProperty(value = "问卷备注信息")
@Excel(name = "问卷备注信息")
private String questionnaireRemark;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("departmentId", getDepartmentId())
.append("departmentName", getDepartmentName())
.append("diseaseTypeId", getDiseaseTypeId())
.append("diseaseTypeName", getDiseaseTypeName())
.append("questionnaireName", getQuestionnaireName())
.append("questionnaireDescription", getQuestionnaireDescription())
.append("answeringMethod", getAnsweringMethod())
.append("questionnaireId", getQuestionnaireId())
.append("questionCount", getQuestionCount())
.append("questionnaireTotalScore", getQuestionnaireTotalScore())
.append("questionnaireStatus", getQuestionnaireStatus())
.append("questionnaireSort", getQuestionnaireSort())
.append("questionnaireRemark", getQuestionnaireRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,69 @@
package com.xinelu.manage.domain.subdivisioncategory;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 细分类别信息对象 subdivision_category
*
* @author xinelu
* @date 2024-02-28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "细分类别信息对象", description = "subdivision_category")
public class SubdivisionCategory extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* 细分类别名称
*/
@ApiModelProperty(value = "细分类别名称")
@Excel(name = "细分类别名称")
private String subdivisionCategoryName;
/**
* 细分类别编码
*/
@ApiModelProperty(value = "细分类别编码")
@Excel(name = "细分类别编码")
private String subdivisionCategoryCode;
/**
* 细分类别排序
*/
@ApiModelProperty(value = "细分类别排序")
@Excel(name = "细分类别排序")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("subdivisionCategoryName", getSubdivisionCategoryName())
.append("subdivisionCategoryCode", getSubdivisionCategoryCode())
.append("sort", getSort())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -2,6 +2,7 @@ package com.xinelu.manage.mapper.agency;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.vo.agency.AgencyVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -21,6 +22,14 @@ public interface AgencyMapper {
*/
Agency selectAgencyById(Long id);
/**
* 查询下级机构信息
*
* @param id 机构信息主键
* @return 机构信息
*/
List<Agency> selectSubordinateAgencyById(Long[] id);
/**
* 查询机构信息
*
@ -37,6 +46,14 @@ public interface AgencyMapper {
*/
List<Agency> selectAgencyList(Agency agency);
/**
* 查询机构信息列表
*
* @param agency 机构信息
* @return 机构信息集合
*/
List<AgencyVO> selectAgencyVOList(Agency agency);
/**
* 新增机构信息
*
@ -68,4 +85,20 @@ public interface AgencyMapper {
* @return 结果
*/
int deleteAgencyByIds(Long[] ids);
/**
* 查询所有的机构信息
*
* @param agencyNames 机构信息集合
* @return 列表集合信息
*/
List<Agency> getAllAgencyInfo(@Param("agencyNames") List<String> agencyNames);
/**
* 机构信息导入
*
* @param agencyList 机构信息
* @return int
**/
int insertAgencyImportList(List<Agency> agencyList);
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.mapper.agencycategory;
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
import com.xinelu.manage.vo.agencycategory.AgencyCategoryVO;
import java.util.List;
@ -28,6 +29,14 @@ public interface AgencyCategoryMapper {
*/
List<AgencyCategory> selectAgencyCategoryList(AgencyCategory agencyCategory);
/**
* 查询机构类别列表
*
* @param agencyCategory 机构类别
* @return 机构类别集合
*/
List<AgencyCategoryVO> selectAgencyCategoryVOList(AgencyCategory agencyCategory);
/**
* 新增机构类别
*

View File

@ -0,0 +1,62 @@
package com.xinelu.manage.mapper.questioninfo;
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import java.util.List;
/**
* 问卷基本信息Mapper接口
*
* @author xinelu
* @date 2024-02-28
*/
public interface QuestionInfoMapper {
/**
* 查询问卷基本信息
*
* @param id 问卷基本信息主键
* @return 问卷基本信息
*/
public QuestionInfo selectQuestionInfoById(Long id);
/**
* 查询问卷基本信息列表
*
* @param questionInfo 问卷基本信息
* @return 问卷基本信息集合
*/
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
/**
* 新增问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
public int insertQuestionInfo(QuestionInfo questionInfo);
/**
* 修改问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
public int updateQuestionInfo(QuestionInfo questionInfo);
/**
* 删除问卷基本信息
*
* @param id 问卷基本信息主键
* @return 结果
*/
public int deleteQuestionInfoById(Long id);
/**
* 批量删除问卷基本信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteQuestionInfoByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package com.xinelu.manage.mapper.subdivisioncategory;
import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory;
import java.util.List;
/**
* 细分类别信息Mapper接口
*
* @author xinelu
* @date 2024-02-28
*/
public interface SubdivisionCategoryMapper {
/**
* 查询细分类别信息
*
* @param id 细分类别信息主键
* @return 细分类别信息
*/
public SubdivisionCategory selectSubdivisionCategoryById(Long id);
/**
* 查询细分类别信息列表
*
* @param subdivisionCategory 细分类别信息
* @return 细分类别信息集合
*/
public List<SubdivisionCategory> selectSubdivisionCategoryList(SubdivisionCategory subdivisionCategory);
/**
* 新增细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory);
/**
* 修改细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory);
/**
* 删除细分类别信息
*
* @param id 细分类别信息主键
* @return 结果
*/
public int deleteSubdivisionCategoryById(Long id);
/**
* 批量删除细分类别信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSubdivisionCategoryByIds(Long[] ids);
}

View File

@ -1,6 +1,8 @@
package com.xinelu.manage.mapper.sysarea;
import com.xinelu.manage.domain.sysarea.SysArea;
import com.xinelu.manage.vo.sysarea.SysAreaVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -19,4 +21,12 @@ public interface SysAreaMapper {
* @return 区域集合
*/
List<SysArea> selectSysAreaList(SysArea sysArea);
/**
* 下级区域寻找上级区域
*
* @param areaCode 区域编码
* @return com.xinyilu.base.domain.vo.sysarea.SysAreaVO
**/
SysAreaVO getSubordinateRegionsFindSuperiorRegions(@Param("areaCode") String areaCode);
}

View File

@ -1,7 +1,9 @@
package com.xinelu.manage.service.agency;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.vo.agency.AgencyTreeVO;
import com.xinelu.manage.vo.agency.AgencyVO;
import java.util.List;
@ -19,7 +21,7 @@ public interface IAgencyService {
* @param id 机构信息主键
* @return 机构信息
*/
Agency selectAgencyById(Long id);
AgencyVO selectAgencyById(Long id);
/**
* 查询机构信息列表
@ -51,7 +53,7 @@ public interface IAgencyService {
* @param ids 需要删除的机构信息主键集合
* @return 结果
*/
int deleteAgencyByIds(Long[] ids);
AjaxResult deleteAgencyByIds(Long[] ids);
/**
* 删除机构信息信息
@ -67,4 +69,13 @@ public interface IAgencyService {
* @return AgencyVO
*/
List<AgencyTreeVO> agencyList();
/**
* 机构信息导入
*
* @param agencyList 机构信息
* @return int
**/
AjaxResult insertAgencyImportList(List<Agency> agencyList);
}

View File

@ -1,15 +1,27 @@
package com.xinelu.manage.service.agency.impl;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.regex.RegexUtil;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.mapper.agency.AgencyMapper;
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
import com.xinelu.manage.service.agency.IAgencyService;
import com.xinelu.manage.vo.agency.AgencyTreeVO;
import com.xinelu.manage.vo.agency.AgencyVO;
import com.xinelu.manage.vo.sysarea.SysAreaVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@ -25,6 +37,10 @@ import java.util.stream.Collectors;
public class AgencyServiceImpl implements IAgencyService {
@Resource
private AgencyMapper agencyMapper;
@Resource
private RegexUtil regexUtil;
@Resource
private SysAreaMapper sysAreaMapper;
/**
* 查询机构信息
@ -33,8 +49,20 @@ public class AgencyServiceImpl implements IAgencyService {
* @return 机构信息
*/
@Override
public Agency selectAgencyById(Long id) {
return agencyMapper.selectAgencyById(id);
public AgencyVO selectAgencyById(Long id) {
AgencyVO agency = agencyMapper.selectAgencyVOById(id);
if (StringUtils.isNotBlank(agency.getAreaCode())) {
SysAreaVO nurseStationAndAreaCode = sysAreaMapper.getSubordinateRegionsFindSuperiorRegions(agency.getAreaCode());
agency.setProvinceCode(StringUtils.isBlank(nurseStationAndAreaCode.getProvinceCode()) ? "" : nurseStationAndAreaCode.getProvinceCode());
agency.setProvinceName(StringUtils.isBlank(nurseStationAndAreaCode.getProvinceName()) ? "" : nurseStationAndAreaCode.getProvinceName());
agency.setCityCode(StringUtils.isBlank(nurseStationAndAreaCode.getCityCode()) ? "" : nurseStationAndAreaCode.getCityCode());
agency.setCityName(StringUtils.isBlank(nurseStationAndAreaCode.getCityName()) ? "" : nurseStationAndAreaCode.getCityName());
agency.setRegionCode(StringUtils.isBlank(nurseStationAndAreaCode.getRegionCode()) ? "" : nurseStationAndAreaCode.getRegionCode());
agency.setRegionName(StringUtils.isBlank(nurseStationAndAreaCode.getRegionName()) ? "" : nurseStationAndAreaCode.getRegionName());
agency.setStreetCode(StringUtils.isBlank(nurseStationAndAreaCode.getStreetCode()) ? "" : nurseStationAndAreaCode.getStreetCode());
agency.setStreetName(StringUtils.isBlank(nurseStationAndAreaCode.getStreetName()) ? "" : nurseStationAndAreaCode.getStreetName());
}
return agency;
}
/**
@ -57,6 +85,7 @@ public class AgencyServiceImpl implements IAgencyService {
@Override
public int insertAgency(Agency agency) {
agency.setCreateTime(DateUtils.getNowDate());
agency.setCreateBy(SecurityUtils.getUsername());
return agencyMapper.insertAgency(agency);
}
@ -69,6 +98,7 @@ public class AgencyServiceImpl implements IAgencyService {
@Override
public int updateAgency(Agency agency) {
agency.setUpdateTime(DateUtils.getNowDate());
agency.setUpdateBy(SecurityUtils.getUsername());
return agencyMapper.updateAgency(agency);
}
@ -79,8 +109,12 @@ public class AgencyServiceImpl implements IAgencyService {
* @return 结果
*/
@Override
public int deleteAgencyByIds(Long[] ids) {
return agencyMapper.deleteAgencyByIds(ids);
public AjaxResult deleteAgencyByIds(Long[] ids) {
int size = agencyMapper.selectSubordinateAgencyById(ids).size();
if (size > 0) {
return AjaxResult.error("该机构存在下级机构,请先删除其下级机构!");
}
return AjaxResult.success(agencyMapper.deleteAgencyByIds(ids));
}
/**
@ -101,18 +135,64 @@ public class AgencyServiceImpl implements IAgencyService {
*/
@Override
public List<AgencyTreeVO> agencyList() {
List<Agency> agencies = agencyMapper.selectAgencyList(null);
List<Agency> agenciesTree = buildDeptTree(agencies);
List<AgencyVO> agencies = agencyMapper.selectAgencyVOList(null);
for (AgencyVO agency : agencies) {
agency.setValue(agency.getId().toString());
}
List<AgencyVO> agenciesTree = buildDeptTree(agencies);
return agenciesTree.stream().map(AgencyTreeVO::new).collect(Collectors.toList());
}
public List<Agency> buildDeptTree(List<Agency> agencies) {
List<Agency> returnList = new ArrayList<Agency>();
/**
* 机构信息导入
*
* @param agencyList 机构信息
* @return 导入结果
**/
@Transactional(rollbackFor = Exception.class)
@Override
public AjaxResult insertAgencyImportList(List<Agency> agencyList) {
//判断添加的数据是否为空
if (CollectionUtils.isEmpty(agencyList)) {
return AjaxResult.error("请添加机构导入信息!");
}
//根据护理站名称做去除处理
List<Agency> importDataList = agencyList.stream().filter(item -> StringUtils.isNotBlank(item.getAgencyName())).distinct().collect(Collectors.toList());
//校验联系电话格式是否正确
Agency agency = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getAgencyPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getAgencyPhone()))).findFirst().orElse(new Agency());
if (StringUtils.isNotBlank(agency.getAgencyPhone())) {
return AjaxResult.error("当前机构联系电话:" + agency.getAgencyPhone() + " 格式不正确,请重新录入!");
}
List<String> agencyNames = importDataList.stream().filter(item -> StringUtils.isNotBlank(item.getAgencyName())).map(Agency::getAgencyName).distinct().collect(Collectors.toList());
//根据名称查询护理站基本信息
List<Agency> allNurseStationInfo = agencyMapper.getAllAgencyInfo(agencyNames);
//做差集去除数据库中已经存在的护理站信息
List<Agency> subtractList = new ArrayList<>(CollectionUtils.subtract(importDataList, allNurseStationInfo));
if (CollectionUtils.isEmpty(subtractList)) {
return AjaxResult.success();
}
List<Agency> saveAgencyList = new ArrayList<>();
for (Agency item : subtractList) {
item.setCreateBy(SecurityUtils.getUsername());
item.setCreateTime(new Date());
Agency newAgency = new Agency();
BeanUtils.copyProperties(item, newAgency);
saveAgencyList.add(newAgency);
}
int insertCount = agencyMapper.insertAgencyImportList(saveAgencyList);
if (insertCount <= 0) {
throw new ServiceException("导入护理站信息失败,请联系管理员!");
}
return AjaxResult.success();
}
public List<AgencyVO> buildDeptTree(List<AgencyVO> agencies) {
List<AgencyVO> returnList = new ArrayList<AgencyVO>();
List<Long> tempList = new ArrayList<Long>();
for (Agency agency : agencies) {
for (AgencyVO agency : agencies) {
tempList.add(agency.getId());
}
for (Agency agency : agencies) {
for (AgencyVO agency : agencies) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(agency.getParentId())) {
recursionFn(agencies, agency);
@ -125,22 +205,22 @@ public class AgencyServiceImpl implements IAgencyService {
return returnList;
}
private void recursionFn(List<Agency> list, Agency t) {
private void recursionFn(List<AgencyVO> list, AgencyVO t) {
// 得到子节点列表
List<Agency> childList = getChildList(list, t);
List<AgencyVO> childList = getChildList(list, t);
t.setChildren(childList);
for (Agency tChild : childList) {
for (AgencyVO tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
private List<Agency> getChildList(List<Agency> list, Agency t) {
List<Agency> tlist = new ArrayList<Agency>();
Iterator<Agency> it = list.iterator();
private List<AgencyVO> getChildList(List<AgencyVO> list, AgencyVO t) {
List<AgencyVO> tlist = new ArrayList<AgencyVO>();
Iterator<AgencyVO> it = list.iterator();
while (it.hasNext()) {
Agency n = (Agency) it.next();
AgencyVO n = (AgencyVO) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
tlist.add(n);
}
@ -151,7 +231,7 @@ public class AgencyServiceImpl implements IAgencyService {
/**
* 判断是否有子节点
*/
private boolean hasChild(List<Agency> list, Agency t) {
private boolean hasChild(List<AgencyVO> list, AgencyVO t) {
return getChildList(list, t).size() > 0;
}
}

View File

@ -2,7 +2,7 @@ package com.xinelu.manage.service.agencycategory;
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
import com.xinelu.manage.vo.agencycategory.AgencyCategoryVO;
import com.xinelu.manage.vo.agencycategory.AgencyCategoryTreeVO;
import java.util.List;
@ -66,5 +66,5 @@ public interface IAgencyCategoryService {
*
* @return AgencyVO
*/
List<AgencyCategoryVO> agencyCategoryList();
List<AgencyCategoryTreeVO> agencyCategoryList();
}

View File

@ -8,6 +8,7 @@ import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
import com.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper;
import com.xinelu.manage.service.agencycategory.IAgencyCategoryService;
import com.xinelu.manage.vo.agencycategory.AgencyCategoryTreeVO;
import com.xinelu.manage.vo.agencycategory.AgencyCategoryVO;
import org.springframework.stereotype.Service;
@ -111,19 +112,22 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
* @return AgencyCategoryVO
*/
@Override
public List<AgencyCategoryVO> agencyCategoryList() {
List<AgencyCategory> agencyCategoryList = agencyCategoryMapper.selectAgencyCategoryList(null);
List<AgencyCategory> agencyTree = buildDeptTree(agencyCategoryList);
return agencyTree.stream().map(AgencyCategoryVO::new).collect(Collectors.toList());
public List<AgencyCategoryTreeVO> agencyCategoryList() {
List<AgencyCategoryVO> agencyCategoryList = agencyCategoryMapper.selectAgencyCategoryVOList(null);
for (AgencyCategoryVO agencyCategory : agencyCategoryList) {
agencyCategory.setValue(agencyCategory.getId());
}
List<AgencyCategoryVO> agencyTree = buildDeptTree(agencyCategoryList);
return agencyTree.stream().map(AgencyCategoryTreeVO::new).collect(Collectors.toList());
}
public List<AgencyCategory> buildDeptTree(List<AgencyCategory> agencyCategoryList) {
List<AgencyCategory> returnList = new ArrayList<AgencyCategory>();
public List<AgencyCategoryVO> buildDeptTree(List<AgencyCategoryVO> agencyCategoryList) {
List<AgencyCategoryVO> returnList = new ArrayList<AgencyCategoryVO>();
List<Long> tempList = new ArrayList<Long>();
for (AgencyCategory agencyCategory : agencyCategoryList) {
for (AgencyCategoryVO agencyCategory : agencyCategoryList) {
tempList.add(agencyCategory.getId());
}
for (AgencyCategory agencyCategory : agencyCategoryList) {
for (AgencyCategoryVO agencyCategory : agencyCategoryList) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(agencyCategory.getParentCategoryId())) {
recursionFn(agencyCategoryList, agencyCategory);
@ -136,22 +140,22 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
return returnList;
}
private void recursionFn(List<AgencyCategory> list, AgencyCategory t) {
private void recursionFn(List<AgencyCategoryVO> list, AgencyCategoryVO t) {
// 得到子节点列表
List<AgencyCategory> childList = getChildList(list, t);
List<AgencyCategoryVO> childList = getChildList(list, t);
t.setChildren(childList);
for (AgencyCategory tChild : childList) {
for (AgencyCategoryVO tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
private List<AgencyCategory> getChildList(List<AgencyCategory> list, AgencyCategory t) {
List<AgencyCategory> tlist = new ArrayList<AgencyCategory>();
Iterator<AgencyCategory> it = list.iterator();
private List<AgencyCategoryVO> getChildList(List<AgencyCategoryVO> list, AgencyCategoryVO t) {
List<AgencyCategoryVO> tlist = new ArrayList<AgencyCategoryVO>();
Iterator<AgencyCategoryVO> it = list.iterator();
while (it.hasNext()) {
AgencyCategory n = (AgencyCategory) it.next();
AgencyCategoryVO n = (AgencyCategoryVO) it.next();
if (StringUtils.isNotNull(n.getParentCategoryId()) && n.getParentCategoryId().longValue() == t.getId().longValue()) {
tlist.add(n);
}
@ -162,7 +166,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
/**
* 判断是否有子节点
*/
private boolean hasChild(List<AgencyCategory> list, AgencyCategory t) {
private boolean hasChild(List<AgencyCategoryVO> list, AgencyCategoryVO t) {
return getChildList(list, t).size() > 0;
}
}

View File

@ -0,0 +1,10 @@
package com.xinelu.manage.service.importdownload;
/**
* 导入Service接口
*
* @author xinelu
* @date 2024-02-26
*/
public interface ImportDownloadService {
}

View File

@ -0,0 +1,15 @@
package com.xinelu.manage.service.importdownload.impl;
import com.xinelu.manage.service.importdownload.ImportDownloadService;
import org.springframework.stereotype.Service;
/**
* 导入Service业务层处理
*
* @author xinelu
* @date 2024-02-26
*/
@Service
public class ImportDownloadServiceImpl implements ImportDownloadService {
}

View File

@ -0,0 +1,62 @@
package com.xinelu.manage.service.questioninfo;
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import java.util.List;
/**
* 问卷基本信息Service接口
*
* @author xinelu
* @date 2024-02-28
*/
public interface IQuestionInfoService {
/**
* 查询问卷基本信息
*
* @param id 问卷基本信息主键
* @return 问卷基本信息
*/
public QuestionInfo selectQuestionInfoById(Long id);
/**
* 查询问卷基本信息列表
*
* @param questionInfo 问卷基本信息
* @return 问卷基本信息集合
*/
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
/**
* 新增问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
public int insertQuestionInfo(QuestionInfo questionInfo);
/**
* 修改问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
public int updateQuestionInfo(QuestionInfo questionInfo);
/**
* 批量删除问卷基本信息
*
* @param ids 需要删除的问卷基本信息主键集合
* @return 结果
*/
public int deleteQuestionInfoByIds(Long[] ids);
/**
* 删除问卷基本信息信息
*
* @param id 问卷基本信息主键
* @return 结果
*/
public int deleteQuestionInfoById(Long id);
}

View File

@ -0,0 +1,90 @@
package com.xinelu.manage.service.questioninfo.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 问卷基本信息Service业务层处理
*
* @author xinelu
* @date 2024-02-28
*/
@Service
public class QuestionInfoServiceImpl implements IQuestionInfoService {
@Resource
private QuestionInfoMapper questionInfoMapper;
/**
* 查询问卷基本信息
*
* @param id 问卷基本信息主键
* @return 问卷基本信息
*/
@Override
public QuestionInfo selectQuestionInfoById(Long id) {
return questionInfoMapper.selectQuestionInfoById(id);
}
/**
* 查询问卷基本信息列表
*
* @param questionInfo 问卷基本信息
* @return 问卷基本信息
*/
@Override
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo) {
return questionInfoMapper.selectQuestionInfoList(questionInfo);
}
/**
* 新增问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
@Override
public int insertQuestionInfo(QuestionInfo questionInfo) {
questionInfo.setCreateTime(DateUtils.getNowDate());
return questionInfoMapper.insertQuestionInfo(questionInfo);
}
/**
* 修改问卷基本信息
*
* @param questionInfo 问卷基本信息
* @return 结果
*/
@Override
public int updateQuestionInfo(QuestionInfo questionInfo) {
questionInfo.setUpdateTime(DateUtils.getNowDate());
return questionInfoMapper.updateQuestionInfo(questionInfo);
}
/**
* 批量删除问卷基本信息
*
* @param ids 需要删除的问卷基本信息主键
* @return 结果
*/
@Override
public int deleteQuestionInfoByIds(Long[] ids) {
return questionInfoMapper.deleteQuestionInfoByIds(ids);
}
/**
* 删除问卷基本信息信息
*
* @param id 问卷基本信息主键
* @return 结果
*/
@Override
public int deleteQuestionInfoById(Long id) {
return questionInfoMapper.deleteQuestionInfoById(id);
}
}

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.service.subdivisioncategory;
import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory;
import java.util.List;
/**
* 细分类别信息Service接口
*
* @author xinelu
* @date 2024-02-28
*/
public interface ISubdivisionCategoryService {
/**
* 查询细分类别信息
*
* @param id 细分类别信息主键
* @return 细分类别信息
*/
public SubdivisionCategory selectSubdivisionCategoryById(Long id);
/**
* 查询细分类别信息列表
*
* @param subdivisionCategory 细分类别信息
* @return 细分类别信息集合
*/
public List<SubdivisionCategory> selectSubdivisionCategoryList(SubdivisionCategory subdivisionCategory);
/**
* 新增细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory);
/**
* 修改细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory);
/**
* 批量删除细分类别信息
*
* @param ids 需要删除的细分类别信息主键集合
* @return 结果
*/
public int deleteSubdivisionCategoryByIds(Long[] ids);
/**
* 删除细分类别信息信息
*
* @param id 细分类别信息主键
* @return 结果
*/
public int deleteSubdivisionCategoryById(Long id);
}

View File

@ -0,0 +1,91 @@
package com.xinelu.manage.service.subdivisioncategory.impl;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.manage.domain.subdivisioncategory.SubdivisionCategory;
import com.xinelu.manage.mapper.subdivisioncategory.SubdivisionCategoryMapper;
import com.xinelu.manage.service.subdivisioncategory.ISubdivisionCategoryService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 细分类别信息Service业务层处理
*
* @author xinelu
* @date 2024-02-28
*/
@Service
public class SubdivisionCategoryServiceImpl implements ISubdivisionCategoryService {
@Resource
private SubdivisionCategoryMapper subdivisionCategoryMapper;
/**
* 查询细分类别信息
*
* @param id 细分类别信息主键
* @return 细分类别信息
*/
@Override
public SubdivisionCategory selectSubdivisionCategoryById(Long id) {
return subdivisionCategoryMapper.selectSubdivisionCategoryById(id);
}
/**
* 查询细分类别信息列表
*
* @param subdivisionCategory 细分类别信息
* @return 细分类别信息
*/
@Override
public List<SubdivisionCategory> selectSubdivisionCategoryList(SubdivisionCategory subdivisionCategory) {
return subdivisionCategoryMapper.selectSubdivisionCategoryList(subdivisionCategory);
}
/**
* 新增细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
@Override
public int insertSubdivisionCategory(SubdivisionCategory subdivisionCategory) {
subdivisionCategory.setCreateTime(DateUtils.getNowDate());
return subdivisionCategoryMapper.insertSubdivisionCategory(subdivisionCategory);
}
/**
* 修改细分类别信息
*
* @param subdivisionCategory 细分类别信息
* @return 结果
*/
@Override
public int updateSubdivisionCategory(SubdivisionCategory subdivisionCategory) {
subdivisionCategory.setUpdateTime(DateUtils.getNowDate());
return subdivisionCategoryMapper.updateSubdivisionCategory(subdivisionCategory);
}
/**
* 批量删除细分类别信息
*
* @param ids 需要删除的细分类别信息主键
* @return 结果
*/
@Override
public int deleteSubdivisionCategoryByIds(Long[] ids) {
return subdivisionCategoryMapper.deleteSubdivisionCategoryByIds(ids);
}
/**
* 删除细分类别信息信息
*
* @param id 细分类别信息主键
* @return 结果
*/
@Override
public int deleteSubdivisionCategoryById(Long id) {
return subdivisionCategoryMapper.deleteSubdivisionCategoryById(id);
}
}

View File

@ -1,8 +1,6 @@
package com.xinelu.manage.vo.agency;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.xinelu.common.core.domain.entity.SysMenu;
import com.xinelu.manage.domain.agency.Agency;
import java.io.Serializable;
import java.util.List;
@ -27,6 +25,11 @@ public class AgencyTreeVO implements Serializable {
*/
private String label;
/**
* 节点名称
*/
private String value;
/**
* 子节点
*/
@ -37,18 +40,13 @@ public class AgencyTreeVO implements Serializable {
}
public AgencyTreeVO(Agency agency) {
public AgencyTreeVO(AgencyVO agency) {
this.id = agency.getId();
this.label = agency.getAgencyName();
this.value = agency.getValue();
this.children = agency.getChildren().stream().map(AgencyTreeVO::new).collect(Collectors.toList());
}
public AgencyTreeVO(SysMenu menu) {
this.id = menu.getMenuId();
this.label = menu.getMenuName();
this.children = menu.getChildren().stream().map(AgencyTreeVO::new).collect(Collectors.toList());
}
public Long getId() {
return id;
}
@ -65,6 +63,14 @@ public class AgencyTreeVO implements Serializable {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public List<AgencyTreeVO> getChildren() {
return children;
}

View File

@ -1,6 +1,11 @@
package com.xinelu.manage.vo.agency;
import com.xinelu.manage.domain.agency.Agency;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
/**
* 机构树图信息对象vo agency
@ -8,8 +13,66 @@ import com.xinelu.manage.domain.agency.Agency;
* @author xinelu
* @date 2024-02-26
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AgencyVO extends Agency {
private String a;
/**
* 主键id
*/
private String provinceName;
/**
* 父级id
*/
private String provinceCode;
/**
* 主键id
*/
private String cityName;
/**
* 父级id
*/
private String cityCode;
/**
* 主键id
*/
private String regionName;
/**
* 父级id
*/
private String regionCode;
/**
* 主键id
*/
private String streetName;
/**
* 父级id
*/
private String streetCode;
/**
* 上级机构
*/
private String parentAgencyName;
private String value;
private List<AgencyVO> children = new ArrayList<AgencyVO>();
public List<AgencyVO> getChildren() {
return children;
}
public void setChildren(List<AgencyVO> children) {
this.children = children;
}
}

View File

@ -0,0 +1,69 @@
package com.xinelu.manage.vo.agencycategory;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
public class AgencyCategoryTreeVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private Long id;
/**
* 节点名称
*/
private String label;
private Long value;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<AgencyCategoryTreeVO> children;
public AgencyCategoryTreeVO(AgencyCategoryVO agencyCategory) {
this.id = agencyCategory.getId();
this.label = agencyCategory.getCategoryName();
this.value = agencyCategory.getValue();
this.children = agencyCategory.getChildren().stream().map(AgencyCategoryTreeVO::new).collect(Collectors.toList());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
public List<AgencyCategoryTreeVO> getChildren() {
return children;
}
public void setChildren(List<AgencyCategoryTreeVO> children) {
this.children = children;
}
}

View File

@ -1,43 +1,25 @@
package com.xinelu.manage.vo.agencycategory;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.xinelu.manage.domain.agencycategory.AgencyCategory;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class AgencyCategoryVO implements Serializable {
@EqualsAndHashCode(callSuper = true)
@Data
public class AgencyCategoryVO extends AgencyCategory {
private static final long serialVersionUID = 1L;
private Long value;
/**
* 节点ID
*/
private Long id;
private List<AgencyCategoryVO> children = new ArrayList<AgencyCategoryVO>();
/**
* 节点名称
*/
private String label;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<AgencyCategoryVO> children;
public AgencyCategoryVO(AgencyCategory agencyCategory) {
this.id = agencyCategory.getId();
this.label = agencyCategory.getCategoryName();
this.children = agencyCategory.getChildren().stream().map(AgencyCategoryVO::new).collect(Collectors.toList());
public List<AgencyCategoryVO> getChildren() {
return children;
}
public Long getId() {
return id;
public void setChildren(List<AgencyCategoryVO> children) {
this.children = children;
}
public void setId(Long id) {
this.id = id;
}
}
}

View File

@ -0,0 +1,60 @@
package com.xinelu.manage.vo.sysarea;
import lombok.Data;
import java.io.Serializable;
/**
* @author ljh
* @version 1.0
* Create by 2022/9/20 17:58
*/
@Data
public class SysAreaVO implements Serializable {
private static final long serialVersionUID = -6098312186830650793L;
/**
* 省名称
*/
private String provinceName;
/**
* 省区域编码
*/
private String provinceCode;
/**
* 市名称
*/
private String cityName;
/**
* 市区域编码
*/
private String cityCode;
/**
* 区域名称
*/
private String regionName;
/**
* 区区域编码
*/
private String regionCode;
/**
* 街道名称
*/
private String streetName;
/**
* 街道区域编码
*/
private String streetCode;
/**
* 街道区域编码
*/
private String areaCode;
}

View File

@ -5,32 +5,54 @@
<mapper namespace="com.xinelu.manage.mapper.agency.AgencyMapper">
<resultMap type="Agency" id="AgencyResult">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="agencyCategoryId" column="agency_category_id"/>
<result property="agencyCategoryName" column="agency_category_name"/>
<result property="areaCode" column="area_code"/>
<result property="areaName" column="area_name"/>
<result property="agencyName" column="agency_name"/>
<result property="agencyCode" column="agency_code"/>
<result property="agencyAbbreviation" column="agency_abbreviation"/>
<result property="agencyStatus" column="agency_status"/>
<result property="nodeType" column="node_type"/>
<result property="orgAgencyCode" column="org_agency_code"/>
<result property="agencyCategoryManageLevel" column="agency_category_manage_level"/>
<result property="agencyContacts" column="agency_contacts"/>
<result property="agencyPhone" column="agency_phone"/>
<result property="agencyAddress" column="agency_address"/>
<result property="agencyRemark" column="agency_remark"/>
<result property="agencySort" column="agency_sort"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="agencyCategoryId" column="agency_category_id"/>
<result property="agencyCategoryName" column="agency_category_name"/>
<result property="areaCode" column="area_code"/>
<result property="areaName" column="area_name"/>
<result property="agencyName" column="agency_name"/>
<result property="agencyCode" column="agency_code"/>
<result property="agencyAbbreviation" column="agency_abbreviation"/>
<result property="agencyStatus" column="agency_status"/>
<result property="nodeType" column="node_type"/>
<result property="orgAgencyCode" column="org_agency_code"/>
<result property="agencyCategoryManageLevel" column="agency_category_manage_level"/>
<result property="agencyContacts" column="agency_contacts"/>
<result property="agencyPhone" column="agency_phone"/>
<result property="agencyAddress" column="agency_address"/>
<result property="agencyRemark" column="agency_remark"/>
<result property="agencySort" column="agency_sort"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectAgencyVo">
select id, parent_id, agency_category_id, agency_category_name, area_code, area_name, agency_name, agency_code, agency_abbreviation, agency_status, node_type, org_agency_code, agency_category_manage_level, agency_contacts, agency_phone, agency_address, agency_remark, agency_sort, create_by, create_time, update_by, update_time from agency
select id,
parent_id,
agency_category_id,
agency_category_name,
area_code,
area_name,
agency_name,
agency_code,
agency_abbreviation,
agency_status,
node_type,
org_agency_code,
agency_category_manage_level,
agency_contacts,
agency_phone,
agency_address,
agency_remark,
agency_sort,
create_by,
create_time,
update_by,
update_time
from agency
</sql>
<select id="selectAgencyList" parameterType="Agency" resultMap="AgencyResult">
@ -90,14 +112,27 @@
</where>
</select>
<select id="selectAgencyVOList" resultType="com.xinelu.manage.vo.agency.AgencyVO">
<include refid="selectAgencyVo"/>
</select>
<select id="selectAgencyById" parameterType="Long"
resultMap="AgencyResult">
<include refid="selectAgencyVo"/>
where id = #{id}
<include refid="selectAgencyVo"/>
where id = #{id}
</select>
<select id="selectSubordinateAgencyById" resultType="com.xinelu.manage.domain.agency.Agency">
<include refid="selectAgencyVo"/>
where parent_id =
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectAgencyVOById" resultType="com.xinelu.manage.vo.agency.AgencyVO">
select id,
parent_id,
ay.parent_id,
agency_category_id,
agency_category_name,
area_code,
@ -114,177 +149,178 @@
agency_address,
agency_remark,
agency_sort,
(select agency_name from agency where id = parent_id)
from agency
(select agency_name from agency where id = ay.parent_id) AS parentAgencyName
from agency ay
where id = #{id}
</select>
<insert id="insertAgency" parameterType="Agency" useGeneratedKeys="true"
keyProperty="id">
insert into agency
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,
</if>
<if test="agencyCategoryId != null">agency_category_id,
</if>
<if test="agencyCategoryName != null">agency_category_name,
</if>
<if test="areaCode != null">area_code,
</if>
<if test="areaName != null">area_name,
</if>
<if test="agencyName != null">agency_name,
</if>
<if test="agencyCode != null">agency_code,
</if>
<if test="agencyAbbreviation != null">agency_abbreviation,
</if>
<if test="agencyStatus != null">agency_status,
</if>
<if test="nodeType != null">node_type,
</if>
<if test="orgAgencyCode != null">org_agency_code,
</if>
<if test="agencyCategoryManageLevel != null">agency_category_manage_level,
</if>
<if test="agencyContacts != null">agency_contacts,
</if>
<if test="agencyPhone != null">agency_phone,
</if>
<if test="agencyAddress != null">agency_address,
</if>
<if test="agencyRemark != null">agency_remark,
</if>
<if test="agencySort != null">agency_sort,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="parentId != null">parent_id,
</if>
<if test="agencyCategoryId != null">agency_category_id,
</if>
<if test="agencyCategoryName != null">agency_category_name,
</if>
<if test="areaCode != null">area_code,
</if>
<if test="areaName != null">area_name,
</if>
<if test="agencyName != null">agency_name,
</if>
<if test="agencyCode != null">agency_code,
</if>
<if test="agencyAbbreviation != null">agency_abbreviation,
</if>
<if test="agencyStatus != null">agency_status,
</if>
<if test="nodeType != null">node_type,
</if>
<if test="orgAgencyCode != null">org_agency_code,
</if>
<if test="agencyCategoryManageLevel != null">agency_category_manage_level,
</if>
<if test="agencyContacts != null">agency_contacts,
</if>
<if test="agencyPhone != null">agency_phone,
</if>
<if test="agencyAddress != null">agency_address,
</if>
<if test="agencyRemark != null">agency_remark,
</if>
<if test="agencySort != null">agency_sort,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},
</if>
<if test="agencyCategoryId != null">#{agencyCategoryId},
</if>
<if test="agencyCategoryName != null">#{agencyCategoryName},
</if>
<if test="areaCode != null">#{areaCode},
</if>
<if test="areaName != null">#{areaName},
</if>
<if test="agencyName != null">#{agencyName},
</if>
<if test="agencyCode != null">#{agencyCode},
</if>
<if test="agencyAbbreviation != null">#{agencyAbbreviation},
</if>
<if test="agencyStatus != null">#{agencyStatus},
</if>
<if test="nodeType != null">#{nodeType},
</if>
<if test="orgAgencyCode != null">#{orgAgencyCode},
</if>
<if test="agencyCategoryManageLevel != null">#{agencyCategoryManageLevel},
</if>
<if test="agencyContacts != null">#{agencyContacts},
</if>
<if test="agencyPhone != null">#{agencyPhone},
</if>
<if test="agencyAddress != null">#{agencyAddress},
</if>
<if test="agencyRemark != null">#{agencyRemark},
</if>
<if test="agencySort != null">#{agencySort},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="parentId != null">#{parentId},
</if>
<if test="agencyCategoryId != null">#{agencyCategoryId},
</if>
<if test="agencyCategoryName != null">#{agencyCategoryName},
</if>
<if test="areaCode != null">#{areaCode},
</if>
<if test="areaName != null">#{areaName},
</if>
<if test="agencyName != null">#{agencyName},
</if>
<if test="agencyCode != null">#{agencyCode},
</if>
<if test="agencyAbbreviation != null">#{agencyAbbreviation},
</if>
<if test="agencyStatus != null">#{agencyStatus},
</if>
<if test="nodeType != null">#{nodeType},
</if>
<if test="orgAgencyCode != null">#{orgAgencyCode},
</if>
<if test="agencyCategoryManageLevel != null">#{agencyCategoryManageLevel},
</if>
<if test="agencyContacts != null">#{agencyContacts},
</if>
<if test="agencyPhone != null">#{agencyPhone},
</if>
<if test="agencyAddress != null">#{agencyAddress},
</if>
<if test="agencyRemark != null">#{agencyRemark},
</if>
<if test="agencySort != null">#{agencySort},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateAgency" parameterType="Agency">
update agency
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id =
#{parentId},
</if>
<if test="agencyCategoryId != null">agency_category_id =
#{agencyCategoryId},
</if>
<if test="agencyCategoryName != null">agency_category_name =
#{agencyCategoryName},
</if>
<if test="areaCode != null">area_code =
#{areaCode},
</if>
<if test="areaName != null">area_name =
#{areaName},
</if>
<if test="agencyName != null">agency_name =
#{agencyName},
</if>
<if test="agencyCode != null">agency_code =
#{agencyCode},
</if>
<if test="agencyAbbreviation != null">agency_abbreviation =
#{agencyAbbreviation},
</if>
<if test="agencyStatus != null">agency_status =
#{agencyStatus},
</if>
<if test="nodeType != null">node_type =
#{nodeType},
</if>
<if test="orgAgencyCode != null">org_agency_code =
#{orgAgencyCode},
</if>
<if test="agencyCategoryManageLevel != null">agency_category_manage_level =
#{agencyCategoryManageLevel},
</if>
<if test="agencyContacts != null">agency_contacts =
#{agencyContacts},
</if>
<if test="agencyPhone != null">agency_phone =
#{agencyPhone},
</if>
<if test="agencyAddress != null">agency_address =
#{agencyAddress},
</if>
<if test="agencyRemark != null">agency_remark =
#{agencyRemark},
</if>
<if test="agencySort != null">agency_sort =
#{agencySort},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="parentId != null">parent_id =
#{parentId},
</if>
<if test="agencyCategoryId != null">agency_category_id =
#{agencyCategoryId},
</if>
<if test="agencyCategoryName != null">agency_category_name =
#{agencyCategoryName},
</if>
<if test="areaCode != null">area_code =
#{areaCode},
</if>
<if test="areaName != null">area_name =
#{areaName},
</if>
<if test="agencyName != null">agency_name =
#{agencyName},
</if>
<if test="agencyCode != null">agency_code =
#{agencyCode},
</if>
<if test="agencyAbbreviation != null">agency_abbreviation =
#{agencyAbbreviation},
</if>
<if test="agencyStatus != null">agency_status =
#{agencyStatus},
</if>
<if test="nodeType != null">node_type =
#{nodeType},
</if>
<if test="orgAgencyCode != null">org_agency_code =
#{orgAgencyCode},
</if>
<if test="agencyCategoryManageLevel != null">agency_category_manage_level =
#{agencyCategoryManageLevel},
</if>
<if test="agencyContacts != null">agency_contacts =
#{agencyContacts},
</if>
<if test="agencyPhone != null">agency_phone =
#{agencyPhone},
</if>
<if test="agencyAddress != null">agency_address =
#{agencyAddress},
</if>
<if test="agencyRemark != null">agency_remark =
#{agencyRemark},
</if>
<if test="agencySort != null">agency_sort =
#{agencySort},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAgencyById" parameterType="Long">
delete from agency where id = #{id}
delete
from agency
where id = #{id}
</delete>
<delete id="deleteAgencyByIds" parameterType="String">
@ -293,4 +329,85 @@
#{id}
</foreach>
</delete>
<select id="getAllAgencyInfo" resultType="com.xinelu.manage.domain.agency.Agency">
select id,
parent_id,
agency_category_id,
agency_category_name,
area_code,
area_name,
agency_name,
agency_code,
agency_abbreviation,
agency_status,
node_type,
org_agency_code,
agency_category_manage_level,
agency_contacts,
agency_phone,
agency_address,
agency_remark,
agency_sort,
create_by,
create_time,
update_by,
update_time
from agency
<where>
<if test="agencyNames != null and agencyNames.size() > 0">
and agency_name in
<foreach item="agencyName" collection="agencyNames" open="(" separator="," close=")">
#{agencyName}
</foreach>
</if>
</where>
</select>
<insert id="insertAgencyImportList" parameterType="java.util.List">
insert into agency(
parent_id,
agency_category_id,
agency_category_name,
area_code,
area_name,
agency_name,
agency_code,
agency_abbreviation,
agency_status,
node_type,
org_agency_code,
agency_category_manage_level,
agency_contacts,
agency_phone,
agency_address,
agency_remark,
agency_sort,
create_by,
create_time
) values
<foreach item="Agency" index="index" collection="list" separator=",">
(
#{Agency.parentId},
#{Agency.agencyCategoryId},
#{Agency.agencyCategoryName},
#{Agency.areaCode},
#{Agency.areaName},
#{Agency.agencyName},
#{Agency.agencyCode},
#{Agency.agencyAbbreviation},
#{Agency.agencyStatus},
#{Agency.nodeType},
#{Agency.orgAgencyCode},
#{Agency.agencyCategoryManageLevel},
#{Agency.agencyContacts},
#{Agency.agencyPhone},
#{Agency.agencyAddress},
#{Agency.agencyRemark},
#{Agency.agencySort},
#{Agency.createBy},
#{Agency.createTime}
)
</foreach>
</insert>
</mapper>

View File

@ -57,6 +57,10 @@
</where>
</select>
<select id="selectAgencyCategoryVOList" resultType="com.xinelu.manage.vo.agencycategory.AgencyCategoryVO">
<include refid="selectAgencyCategoryVo"/>
</select>
<select id="selectAgencyCategoryById" parameterType="Long"
resultMap="AgencyCategoryResult">
<include refid="selectAgencyCategoryVo"/>

View File

@ -0,0 +1,248 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper">
<resultMap type="QuestionInfo" id="QuestionInfoResult">
<result property="id" column="id"/>
<result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name"/>
<result property="diseaseTypeId" column="disease_type_id"/>
<result property="diseaseTypeName" column="disease_type_name"/>
<result property="questionnaireName" column="questionnaire_name"/>
<result property="questionnaireDescription" column="questionnaire_description"/>
<result property="answeringMethod" column="answering_method"/>
<result property="questionnaireId" column="questionnaire_id"/>
<result property="questionCount" column="question_count"/>
<result property="questionnaireTotalScore" column="questionnaire_total_score"/>
<result property="questionnaireStatus" column="questionnaire_status"/>
<result property="questionnaireSort" column="questionnaire_sort"/>
<result property="questionnaireRemark" column="questionnaire_remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectQuestionInfoVo">
select id,
department_id,
department_name,
disease_type_id,
disease_type_name,
questionnaire_name,
questionnaire_description,
answering_method,
questionnaire_id,
question_count,
questionnaire_total_score,
questionnaire_status,
questionnaire_sort,
questionnaire_remark,
create_by,
create_time,
update_by,
update_time
from question_info
</sql>
<select id="selectQuestionInfoList" parameterType="QuestionInfo" resultMap="QuestionInfoResult">
<include refid="selectQuestionInfoVo"/>
<where>
<if test="departmentId != null ">
and department_id = #{departmentId}
</if>
<if test="departmentName != null and departmentName != ''">
and department_name like concat('%', #{departmentName}, '%')
</if>
<if test="diseaseTypeId != null ">
and disease_type_id = #{diseaseTypeId}
</if>
<if test="diseaseTypeName != null and diseaseTypeName != ''">
and disease_type_name like concat('%', #{diseaseTypeName}, '%')
</if>
<if test="questionnaireName != null and questionnaireName != ''">
and questionnaire_name like concat('%', #{questionnaireName}, '%')
</if>
<if test="questionnaireDescription != null and questionnaireDescription != ''">
and questionnaire_description = #{questionnaireDescription}
</if>
<if test="answeringMethod != null and answeringMethod != ''">
and answering_method = #{answeringMethod}
</if>
<if test="questionnaireId != null and questionnaireId != ''">
and questionnaire_id = #{questionnaireId}
</if>
<if test="questionCount != null ">
and question_count = #{questionCount}
</if>
<if test="questionnaireTotalScore != null ">
and questionnaire_total_score = #{questionnaireTotalScore}
</if>
<if test="questionnaireStatus != null and questionnaireStatus != ''">
and questionnaire_status = #{questionnaireStatus}
</if>
<if test="questionnaireSort != null ">
and questionnaire_sort = #{questionnaireSort}
</if>
<if test="questionnaireRemark != null and questionnaireRemark != ''">
and questionnaire_remark = #{questionnaireRemark}
</if>
</where>
</select>
<select id="selectQuestionInfoById" parameterType="Long"
resultMap="QuestionInfoResult">
<include refid="selectQuestionInfoVo"/>
where id = #{id}
</select>
<insert id="insertQuestionInfo" parameterType="QuestionInfo" useGeneratedKeys="true"
keyProperty="id">
insert into question_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="departmentId != null">department_id,
</if>
<if test="departmentName != null">department_name,
</if>
<if test="diseaseTypeId != null">disease_type_id,
</if>
<if test="diseaseTypeName != null">disease_type_name,
</if>
<if test="questionnaireName != null">questionnaire_name,
</if>
<if test="questionnaireDescription != null">questionnaire_description,
</if>
<if test="answeringMethod != null">answering_method,
</if>
<if test="questionnaireId != null">questionnaire_id,
</if>
<if test="questionCount != null">question_count,
</if>
<if test="questionnaireTotalScore != null">questionnaire_total_score,
</if>
<if test="questionnaireStatus != null">questionnaire_status,
</if>
<if test="questionnaireSort != null">questionnaire_sort,
</if>
<if test="questionnaireRemark != null">questionnaire_remark,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="departmentId != null">#{departmentId},
</if>
<if test="departmentName != null">#{departmentName},
</if>
<if test="diseaseTypeId != null">#{diseaseTypeId},
</if>
<if test="diseaseTypeName != null">#{diseaseTypeName},
</if>
<if test="questionnaireName != null">#{questionnaireName},
</if>
<if test="questionnaireDescription != null">#{questionnaireDescription},
</if>
<if test="answeringMethod != null">#{answeringMethod},
</if>
<if test="questionnaireId != null">#{questionnaireId},
</if>
<if test="questionCount != null">#{questionCount},
</if>
<if test="questionnaireTotalScore != null">#{questionnaireTotalScore},
</if>
<if test="questionnaireStatus != null">#{questionnaireStatus},
</if>
<if test="questionnaireSort != null">#{questionnaireSort},
</if>
<if test="questionnaireRemark != null">#{questionnaireRemark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateQuestionInfo" parameterType="QuestionInfo">
update question_info
<trim prefix="SET" suffixOverrides=",">
<if test="departmentId != null">department_id =
#{departmentId},
</if>
<if test="departmentName != null">department_name =
#{departmentName},
</if>
<if test="diseaseTypeId != null">disease_type_id =
#{diseaseTypeId},
</if>
<if test="diseaseTypeName != null">disease_type_name =
#{diseaseTypeName},
</if>
<if test="questionnaireName != null">questionnaire_name =
#{questionnaireName},
</if>
<if test="questionnaireDescription != null">questionnaire_description =
#{questionnaireDescription},
</if>
<if test="answeringMethod != null">answering_method =
#{answeringMethod},
</if>
<if test="questionnaireId != null">questionnaire_id =
#{questionnaireId},
</if>
<if test="questionCount != null">question_count =
#{questionCount},
</if>
<if test="questionnaireTotalScore != null">questionnaire_total_score =
#{questionnaireTotalScore},
</if>
<if test="questionnaireStatus != null">questionnaire_status =
#{questionnaireStatus},
</if>
<if test="questionnaireSort != null">questionnaire_sort =
#{questionnaireSort},
</if>
<if test="questionnaireRemark != null">questionnaire_remark =
#{questionnaireRemark},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQuestionInfoById" parameterType="Long">
delete
from question_info
where id = #{id}
</delete>
<delete id="deleteQuestionInfoByIds" parameterType="String">
delete from question_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.subdivisioncategory.SubdivisionCategoryMapper">
<resultMap type="SubdivisionCategory" id="SubdivisionCategoryResult">
<result property="id" column="id"/>
<result property="subdivisionCategoryName" column="subdivision_category_name"/>
<result property="subdivisionCategoryCode" column="subdivision_category_code"/>
<result property="sort" column="sort"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectSubdivisionCategoryVo">
select id,
subdivision_category_name,
subdivision_category_code,
sort,
remark,
create_by,
create_time,
update_by,
update_time
from subdivision_category
</sql>
<select id="selectSubdivisionCategoryList" parameterType="SubdivisionCategory"
resultMap="SubdivisionCategoryResult">
<include refid="selectSubdivisionCategoryVo"/>
<where>
<if test="subdivisionCategoryName != null and subdivisionCategoryName != ''">
and subdivision_category_name like concat('%', #{subdivisionCategoryName}, '%')
</if>
<if test="subdivisionCategoryCode != null and subdivisionCategoryCode != ''">
and subdivision_category_code = #{subdivisionCategoryCode}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
</where>
</select>
<select id="selectSubdivisionCategoryById" parameterType="Long"
resultMap="SubdivisionCategoryResult">
<include refid="selectSubdivisionCategoryVo"/>
where id = #{id}
</select>
<insert id="insertSubdivisionCategory" parameterType="SubdivisionCategory" useGeneratedKeys="true"
keyProperty="id">
insert into subdivision_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subdivisionCategoryName != null">subdivision_category_name,
</if>
<if test="subdivisionCategoryCode != null">subdivision_category_code,
</if>
<if test="sort != null">sort,
</if>
<if test="remark != null">remark,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subdivisionCategoryName != null">#{subdivisionCategoryName},
</if>
<if test="subdivisionCategoryCode != null">#{subdivisionCategoryCode},
</if>
<if test="sort != null">#{sort},
</if>
<if test="remark != null">#{remark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateSubdivisionCategory" parameterType="SubdivisionCategory">
update subdivision_category
<trim prefix="SET" suffixOverrides=",">
<if test="subdivisionCategoryName != null">subdivision_category_name =
#{subdivisionCategoryName},
</if>
<if test="subdivisionCategoryCode != null">subdivision_category_code =
#{subdivisionCategoryCode},
</if>
<if test="sort != null">sort =
#{sort},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSubdivisionCategoryById" parameterType="Long">
delete
from subdivision_category
where id = #{id}
</delete>
<delete id="deleteSubdivisionCategoryByIds" parameterType="String">
delete from subdivision_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -57,4 +57,39 @@
</where>
order by sort
</select>
<select id="getSubordinateRegionsFindSuperiorRegions" parameterType="String"
resultType="com.xinelu.manage.vo.sysarea.SysAreaVO">
SELECT province.area_name province_name,
province.area_code province_code,
city.area_name city_name,
city.area_code city_code,
region.area_name region_name,
region.area_code region_code,
street.area_name street_name,
street.area_code street_code
FROM sys_area province,
sys_area city,
sys_area region,
sys_area street
WHERE city.parent_code = province.area_code
AND region.parent_code = city.area_code
AND street.parent_code = region.area_code
AND street.area_code = #{areaCode}
UNION ALL
SELECT province.area_name province_name,
province.area_code province_code,
city.area_name city_name,
city.area_code city_code,
region.area_name region_name,
region.area_code region_code,
'' street_name,
'' street_code
FROM sys_area province,
sys_area city,
sys_area region
WHERE city.parent_code = province.area_code
AND region.parent_code = city.area_code
AND region.area_code = #{areaCode} limit 1;
</select>
</mapper>