From 0a2e7dec82713c50680fe5b4633b3cc88898f1b0 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Mon, 10 Jan 2022 16:09:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EpidemicUserInfoSyncController.java | 94 +++++ .../epidemic/dao/EpidemicUserInfoSyncDao.java | 33 ++ .../epidemic/dto/EpidemicUserInfoSyncDTO.java | 322 ++++++++++++++++++ .../entity/EpidemicUserInfoSyncEntity.java | 288 ++++++++++++++++ .../excel/EpidemicUserInfoSyncExcel.java | 206 +++++++++++ .../service/EpidemicUserInfoSyncService.java | 95 ++++++ .../impl/EpidemicUserInfoSyncServiceImpl.java | 100 ++++++ .../epidemic/EpidemicUserInfoSyncDao.xml | 67 ++++ 8 files changed, 1205 insertions(+) create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoSyncController.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoSyncDao.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoSyncDTO.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoSyncEntity.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/excel/EpidemicUserInfoSyncExcel.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoSyncService.java create mode 100644 epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoSyncServiceImpl.java create mode 100644 epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoSyncDao.xml diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoSyncController.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoSyncController.java new file mode 100644 index 0000000..3085c87 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/controller/EpidemicUserInfoSyncController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoSyncDTO; +import com.elink.esua.epdc.vaccine.epidemic.excel.EpidemicUserInfoSyncExcel; +import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoSyncService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@RestController +@RequestMapping("epidemicuserinfosync") +public class EpidemicUserInfoSyncController { + + @Autowired + private EpidemicUserInfoSyncService epidemicUserInfoSyncService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = epidemicUserInfoSyncService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + EpidemicUserInfoSyncDTO data = epidemicUserInfoSyncService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody EpidemicUserInfoSyncDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + epidemicUserInfoSyncService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody EpidemicUserInfoSyncDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + epidemicUserInfoSyncService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + epidemicUserInfoSyncService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = epidemicUserInfoSyncService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, EpidemicUserInfoSyncExcel.class); + } + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoSyncDao.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoSyncDao.java new file mode 100644 index 0000000..fa52d25 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dao/EpidemicUserInfoSyncDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoSyncEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Mapper +public interface EpidemicUserInfoSyncDao extends BaseDao { + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoSyncDTO.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoSyncDTO.java new file mode 100644 index 0000000..2791910 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/dto/EpidemicUserInfoSyncDTO.java @@ -0,0 +1,322 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Data +public class EpidemicUserInfoSyncDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 姓名 + */ + private String userName; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 户籍地名称 + */ + private String householdRegisterName; + + /** + * 户籍地详细地址 + */ + private String householdRegisterDetail; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 逻辑删除标识 + */ + private String delFlag; + + /** + * 性别 + */ + private String gender; + + /** + * 民族 + */ + private String nation; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 出生年月 + */ + private String birthday; + + /** + * 身高 + */ + private String height; + + /** + * 文化程度 + */ + private String standardOfCulture; + + /** + * 健康情况 + */ + private String health; + + /** + * 婚姻状况 + */ + private String maritalStatus; + + /** + * 与户主关系 + */ + private String relation; + + /** + * 国籍 + */ + private String nationality; + + /** + * 政治面貌 + */ + private String politicsStatus; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 毕业院校 + */ + private String graduateSchool; + + /** + * 专业 + */ + private String professional; + + /** + * 工作状态 + */ + private String workStatus; + + /** + * 行业类别 + */ + private String industryCategory; + + /** + * 工作单位(现/原) + */ + private String workUnits; + + /** + * 兵役状况 + */ + private String military; + + /** + * 人口类别 + */ + private String peopleCategories; + + /** + * 特殊人群 + */ + private String specialCrowd; + + /** + * 有无车辆 + */ + private String car; + + /** + * 车牌号 + */ + private String carNo; + + /** + * 人户状况 + */ + private String hushaiStatus; + + /** + * 籍贯 + */ + private String nativePlace; + + /** + * 血型 + */ + private String bloodType; + + /** + * 县内居住地镇街 + */ + private String liveAddressName; + + /** + * 社区/村庄 + */ + private String community; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 手机号或座机号 + */ + private String mobile; + + /** + * 现单位地址 + */ + private String currentEmployerAddress; + + /** + * 房屋性质 + */ + private String houseProperty; + + /** + * 所属部门ID + */ + private Long deptId; + + /** + * 所属部门 + */ + private String deptName; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 小区 + */ + private String plot; + + /** + * 楼号 + */ + private String buildingNo; + + /** + * 单元 + */ + private String unit; + + /** + * 房间号 + */ + private String roomNo; + + /** + * 家庭保障情况 + */ + private String familySecurity; + + /** + * 居住情况 + */ + private String livingSituation; + + /** + * 现居住地详细地址 + */ + private String outLiveAddressDetail; + + /** + * 同步状态:Y同步成功 N未同步 F同步失败 + */ + private String syncState; + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoSyncEntity.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoSyncEntity.java new file mode 100644 index 0000000..a1cff24 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/entity/EpidemicUserInfoSyncEntity.java @@ -0,0 +1,288 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epidemic_user_info_sync") +public class EpidemicUserInfoSyncEntity extends BasePingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + private String userName; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 户籍地名称 + */ + private String householdRegisterName; + + /** + * 户籍地详细地址 + */ + private String householdRegisterDetail; + + /** + * 性别 + */ + private String gender; + + /** + * 民族 + */ + private String nation; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 出生年月 + */ + private String birthday; + + /** + * 身高 + */ + private String height; + + /** + * 文化程度 + */ + private String standardOfCulture; + + /** + * 健康情况 + */ + private String health; + + /** + * 婚姻状况 + */ + private String maritalStatus; + + /** + * 与户主关系 + */ + private String relation; + + /** + * 国籍 + */ + private String nationality; + + /** + * 政治面貌 + */ + private String politicsStatus; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 毕业院校 + */ + private String graduateSchool; + + /** + * 专业 + */ + private String professional; + + /** + * 工作状态 + */ + private String workStatus; + + /** + * 行业类别 + */ + private String industryCategory; + + /** + * 工作单位(现/原) + */ + private String workUnits; + + /** + * 兵役状况 + */ + private String military; + + /** + * 人口类别 + */ + private String peopleCategories; + + /** + * 特殊人群 + */ + private String specialCrowd; + + /** + * 有无车辆 + */ + private String car; + + /** + * 车牌号 + */ + private String carNo; + + /** + * 人户状况 + */ + private String hushaiStatus; + + /** + * 籍贯 + */ + private String nativePlace; + + /** + * 血型 + */ + private String bloodType; + + /** + * 县内居住地镇街 + */ + private String liveAddressName; + + /** + * 社区/村庄 + */ + private String community; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 手机号或座机号 + */ + private String mobile; + + /** + * 现单位地址 + */ + private String currentEmployerAddress; + + /** + * 房屋性质 + */ + private String houseProperty; + + /** + * 所属部门ID + */ + private Long deptId; + + /** + * 所属部门 + */ + private String deptName; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 房屋地址 + */ + private String houseAddress; + + /** + * 小区 + */ + private String plot; + + /** + * 楼号 + */ + private String buildingNo; + + /** + * 单元 + */ + private String unit; + + /** + * 房间号 + */ + private String roomNo; + + /** + * 家庭保障情况 + */ + private String familySecurity; + + /** + * 居住情况 + */ + private String livingSituation; + + /** + * 现居住地详细地址 + */ + private String outLiveAddressDetail; + + /** + * 同步状态:Y同步成功 N未同步 F同步失败 + */ + private String syncState; + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/excel/EpidemicUserInfoSyncExcel.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/excel/EpidemicUserInfoSyncExcel.java new file mode 100644 index 0000000..ea1bf90 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/excel/EpidemicUserInfoSyncExcel.java @@ -0,0 +1,206 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Data +public class EpidemicUserInfoSyncExcel { + + @Excel(name = "主键") + private Long id; + + @Excel(name = "姓名") + private String userName; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "户籍地名称") + private String householdRegisterName; + + @Excel(name = "户籍地详细地址") + private String householdRegisterDetail; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "逻辑删除标识") + private String delFlag; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "民族") + private String nation; + + @Excel(name = "曾用名") + private String formerName; + + @Excel(name = "出生年月") + private String birthday; + + @Excel(name = "身高") + private String height; + + @Excel(name = "文化程度") + private String standardOfCulture; + + @Excel(name = "健康情况") + private String health; + + @Excel(name = "婚姻状况") + private String maritalStatus; + + @Excel(name = "与户主关系") + private String relation; + + @Excel(name = "国籍") + private String nationality; + + @Excel(name = "政治面貌") + private String politicsStatus; + + @Excel(name = "宗教信仰") + private String faith; + + @Excel(name = "毕业院校") + private String graduateSchool; + + @Excel(name = "专业") + private String professional; + + @Excel(name = "工作状态") + private String workStatus; + + @Excel(name = "行业类别") + private String industryCategory; + + @Excel(name = "工作单位(现/原)") + private String workUnits; + + @Excel(name = "兵役状况") + private String military; + + @Excel(name = "人口类别") + private String peopleCategories; + + @Excel(name = "特殊人群") + private String specialCrowd; + + @Excel(name = "有无车辆") + private String car; + + @Excel(name = "车牌号") + private String carNo; + + @Excel(name = "人户状况") + private String hushaiStatus; + + @Excel(name = "籍贯") + private String nativePlace; + + @Excel(name = "血型") + private String bloodType; + + @Excel(name = "县内居住地镇街") + private String liveAddressName; + + @Excel(name = "社区/村庄") + private String community; + + @Excel(name = "网格名称") + private String gridName; + + @Excel(name = "手机号或座机号") + private String mobile; + + @Excel(name = "现单位地址") + private String currentEmployerAddress; + + @Excel(name = "房屋性质") + private String houseProperty; + + @Excel(name = "所属部门ID") + private Long deptId; + + @Excel(name = "所属部门") + private String deptName; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + @Excel(name = "房屋地址") + private String houseAddress; + + @Excel(name = "小区") + private String plot; + + @Excel(name = "楼号") + private String buildingNo; + + @Excel(name = "单元") + private String unit; + + @Excel(name = "房间号") + private String roomNo; + + @Excel(name = "家庭保障情况") + private String familySecurity; + + @Excel(name = "居住情况") + private String livingSituation; + + @Excel(name = "现居住地详细地址") + private String outLiveAddressDetail; + + @Excel(name = "同步状态:Y同步成功 N未同步 F同步失败 ") + private String syncState; + + +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoSyncService.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoSyncService.java new file mode 100644 index 0000000..159e86c --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/EpidemicUserInfoSyncService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoSyncDTO; +import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoSyncEntity; + +import java.util.List; +import java.util.Map; + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +public interface EpidemicUserInfoSyncService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-01-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-01-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return EpidemicUserInfoSyncDTO + * @author generator + * @date 2022-01-10 + */ + EpidemicUserInfoSyncDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-10 + */ + void save(EpidemicUserInfoSyncDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-01-10 + */ + void update(EpidemicUserInfoSyncDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-01-10 + */ + void delete(String[] ids); +} diff --git a/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoSyncServiceImpl.java b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoSyncServiceImpl.java new file mode 100644 index 0000000..93a0690 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoSyncServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.vaccine.epidemic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoSyncDao; +import com.elink.esua.epdc.vaccine.epidemic.dto.EpidemicUserInfoSyncDTO; +import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoSyncEntity; +import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoSyncService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 疫情防控信息同步表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2022-01-10 + */ +@Service +public class EpidemicUserInfoSyncServiceImpl extends BaseServiceImpl implements EpidemicUserInfoSyncService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EpidemicUserInfoSyncDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, EpidemicUserInfoSyncDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public EpidemicUserInfoSyncDTO get(String id) { + EpidemicUserInfoSyncEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EpidemicUserInfoSyncDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(EpidemicUserInfoSyncDTO dto) { + EpidemicUserInfoSyncEntity entity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoSyncEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EpidemicUserInfoSyncDTO dto) { + EpidemicUserInfoSyncEntity entity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoSyncEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoSyncDao.xml b/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoSyncDao.xml new file mode 100644 index 0000000..49426a8 --- /dev/null +++ b/epdc-cloud-vim-yushan/src/main/resources/mapper/epidemic/EpidemicUserInfoSyncDao.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +