22 changed files with 1392 additions and 33 deletions
@ -0,0 +1,106 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.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.vim.dto.VaccinationRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.excel.VaccinationRoleExcel; |
|||
import com.elink.esua.epdc.vaccine.vim.service.VaccinationRoleService; |
|||
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 zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("vaccinationrole") |
|||
public class VaccinationRoleController { |
|||
|
|||
@Autowired |
|||
private VaccinationRoleService vaccinationRoleService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<VaccinationRoleDTO>> page(@RequestParam Map<String, Object> params) { |
|||
PageData<VaccinationRoleDTO> page = vaccinationRoleService.page(params); |
|||
return new Result<PageData<VaccinationRoleDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<VaccinationRoleDTO> get(@PathVariable("id") Long id) { |
|||
VaccinationRoleDTO data = vaccinationRoleService.get(id); |
|||
return new Result<VaccinationRoleDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody VaccinationRoleDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
vaccinationRoleService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody VaccinationRoleDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
vaccinationRoleService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody Long[] ids) { |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
vaccinationRoleService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<VaccinationRoleDTO> list = vaccinationRoleService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, VaccinationRoleExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* 展示角色列表 |
|||
* |
|||
* @param params |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < SysUserDTO>> |
|||
* @author zhy |
|||
* @date 2021/5/31 15:55 |
|||
*/ |
|||
@GetMapping("roleList") |
|||
public Result<List<VaccinationRoleDTO>> roleList(@RequestParam Map<String, Object> params) { |
|||
return new Result<List<VaccinationRoleDTO>>().ok(vaccinationRoleService.list(params)); |
|||
} |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.annotation.LogOperation; |
|||
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.vim.dto.VaccinationUserRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.excel.VaccinationUserRoleExcel; |
|||
import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService; |
|||
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 zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("vaccinationuserrole") |
|||
public class VaccinationUserRoleController { |
|||
|
|||
@Autowired |
|||
private VaccinationUserRoleService vaccinationUserRoleService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<VaccinationUserRoleDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<VaccinationUserRoleDTO> page = vaccinationUserRoleService.page(params); |
|||
return new Result<PageData<VaccinationUserRoleDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<VaccinationUserRoleDTO> get(@PathVariable("id") Long id){ |
|||
VaccinationUserRoleDTO data = vaccinationUserRoleService.get(id); |
|||
return new Result<VaccinationUserRoleDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody VaccinationUserRoleDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
vaccinationUserRoleService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody VaccinationUserRoleDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
vaccinationUserRoleService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody Long[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
vaccinationUserRoleService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<VaccinationUserRoleDTO> list = vaccinationUserRoleService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, VaccinationUserRoleExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Mapper |
|||
public interface VaccinationRoleDao extends BaseDao<VaccinationRoleEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Mapper |
|||
public interface VaccinationUserRoleDao extends BaseDao<VaccinationUserRoleEntity> { |
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO> |
|||
* @author zhy |
|||
* @date 2021/5/31 15:31 |
|||
*/ |
|||
List<VaccinationUserRoleDTO> getList(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 根据用户ID删除 |
|||
* |
|||
* @param userId |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/5/31 16:21 |
|||
*/ |
|||
void deleteByUserId(@Param("userId") Long userId); |
|||
|
|||
/** |
|||
* 根据用户ID查找 |
|||
* |
|||
* @param userId |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/5/31 16:21 |
|||
*/ |
|||
List<VaccinationUserRoleDTO> selectByUserId(@Param("userId") Long userId); |
|||
|
|||
/** |
|||
* 根据用户ID查找 |
|||
* |
|||
* @param userId |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/5/31 16:21 |
|||
*/ |
|||
List<VaccinationRoleDTO> selectRoleByUserId(@Param("userId") Long userId); |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
public class VaccinationAuthDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 县/区关键词 |
|||
*/ |
|||
private List<String> countyKeywords; |
|||
|
|||
/** |
|||
* 街道/乡镇关键词 |
|||
*/ |
|||
private List<String> streetKeywords; |
|||
|
|||
/** |
|||
* 社区/村关键词 |
|||
*/ |
|||
private List<String> communityKeywords; |
|||
|
|||
/** |
|||
* 网格关键词 |
|||
*/ |
|||
private List<String> gridKeywords; |
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
public class VaccinationRoleDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private Long id; |
|||
|
|||
/** |
|||
* 角色名称 |
|||
*/ |
|||
private String roleName; |
|||
|
|||
/** |
|||
* 县/区关键词 |
|||
*/ |
|||
private String countyKeywords; |
|||
|
|||
/** |
|||
* 街道/乡镇关键词 |
|||
*/ |
|||
private String streetKeywords; |
|||
|
|||
/** |
|||
* 社区/村关键词 |
|||
*/ |
|||
private String communityKeywords; |
|||
|
|||
/** |
|||
* 网格关键词 |
|||
*/ |
|||
private String gridKeywords; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
public class VaccinationUserRoleDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private Long id; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 用户 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
private Long roleId; |
|||
|
|||
/** |
|||
* 角色 |
|||
*/ |
|||
private String roleName; |
|||
|
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
private List<Long> roleIds; |
|||
|
|||
/** |
|||
* 角色 |
|||
*/ |
|||
private String roleNames; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("vaccination_role") |
|||
public class VaccinationRoleEntity extends BasePingyinEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 角色名称 |
|||
*/ |
|||
private String roleName; |
|||
|
|||
/** |
|||
* 县/区关键词 |
|||
*/ |
|||
private String countyKeywords; |
|||
|
|||
/** |
|||
* 街道/乡镇关键词 |
|||
*/ |
|||
private String streetKeywords; |
|||
|
|||
/** |
|||
* 社区/村关键词 |
|||
*/ |
|||
private String communityKeywords; |
|||
|
|||
/** |
|||
* 网格关键词 |
|||
*/ |
|||
private String gridKeywords; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("vaccination_user_role") |
|||
public class VaccinationUserRoleEntity extends BasePingyinEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
private Long roleId; |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
public class VaccinationRoleExcel { |
|||
|
|||
@Excel(name = "ID") |
|||
private Long id; |
|||
|
|||
@Excel(name = "角色名称") |
|||
private String roleName; |
|||
|
|||
@Excel(name = "县/区关键词") |
|||
private String countyKeywords; |
|||
|
|||
@Excel(name = "街道/乡镇关键词") |
|||
private String streetKeywords; |
|||
|
|||
@Excel(name = "社区/村关键词") |
|||
private String communityKeywords; |
|||
|
|||
@Excel(name = "网格关键词") |
|||
private String gridKeywords; |
|||
|
|||
@Excel(name = "备注") |
|||
private String remark; |
|||
|
|||
@Excel(name = "删除标识 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Data |
|||
public class VaccinationUserRoleExcel { |
|||
|
|||
@Excel(name = "ID") |
|||
private Long id; |
|||
|
|||
@Excel(name = "用户id") |
|||
private Long userId; |
|||
|
|||
@Excel(name = "角色ID") |
|||
private Long roleId; |
|||
|
|||
@Excel(name = "删除标识 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.service; |
|||
|
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.CrudService; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; |
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
public interface VaccinationRoleService extends CrudService<VaccinationRoleEntity, VaccinationRoleDTO> { |
|||
|
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.CrudService; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
public interface VaccinationUserRoleService extends CrudService<VaccinationUserRoleEntity, VaccinationUserRoleDTO> { |
|||
|
|||
/** |
|||
* 获取用户的所有接种数据权限 |
|||
* |
|||
* @param userId |
|||
* @return com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO |
|||
* @author zhy |
|||
* @date 2021/5/31 17:27 |
|||
*/ |
|||
VaccinationAuthDTO getVaccinationAuth(Long userId); |
|||
|
|||
/** |
|||
* 获取用户的所有接种数据权限 |
|||
* |
|||
* @param userId |
|||
* @return com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO |
|||
* @author zhy |
|||
* @date 2021/5/31 17:27 |
|||
*/ |
|||
Map<String, Object> getVaccinationAuthParams(Long userId); |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl; |
|||
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationRoleDao; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity; |
|||
import com.elink.esua.epdc.vaccine.vim.service.VaccinationRoleService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 接种登记人员角色管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Service |
|||
public class VaccinationRoleServiceImpl extends BaseVimCurdServiceImpl<VaccinationRoleDao, VaccinationRoleEntity, VaccinationRoleDTO> implements VaccinationRoleService { |
|||
|
|||
@Override |
|||
public QueryWrapper<VaccinationRoleEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<VaccinationRoleEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.orderByDesc("CREATED_TIME"); |
|||
String roleName = (String) params.get("roleName"); |
|||
wrapper.like(StringUtils.isNotBlank(roleName), "ROLE_NAME", roleName); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(VaccinationRoleDTO dto) { |
|||
VaccinationRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationRoleEntity.class); |
|||
entity.setCountyKeywords(replacePunctuation(entity.getCountyKeywords().trim())); |
|||
entity.setStreetKeywords(replacePunctuation(entity.getStreetKeywords().trim())); |
|||
entity.setCommunityKeywords(replacePunctuation(entity.getCommunityKeywords().trim())); |
|||
entity.setGridKeywords(replacePunctuation(entity.getGridKeywords().trim())); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(VaccinationRoleDTO dto) { |
|||
VaccinationRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationRoleEntity.class); |
|||
entity.setCountyKeywords(replacePunctuation(entity.getCountyKeywords().trim())); |
|||
entity.setStreetKeywords(replacePunctuation(entity.getStreetKeywords().trim())); |
|||
entity.setCommunityKeywords(replacePunctuation(entity.getCommunityKeywords().trim())); |
|||
entity.setGridKeywords(replacePunctuation(entity.getGridKeywords().trim())); |
|||
updateById(entity); |
|||
} |
|||
|
|||
/** |
|||
* 所有的标点替换为英文逗号 |
|||
* |
|||
* @param str |
|||
* @return java.lang.String |
|||
* @author zhy |
|||
* @date 2021/5/31 15:17 |
|||
*/ |
|||
private String replacePunctuation(String str) { |
|||
return str.replaceAll("[\\pP\\p{Punct}]", ","); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,166 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* 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. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.vim.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; |
|||
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|||
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.vaccine.common.base.BaseVimCurdServiceImpl; |
|||
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationUserRoleDao; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationAuthDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO; |
|||
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity; |
|||
import com.elink.esua.epdc.vaccine.vim.service.VaccinationUserRoleService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 接种登记人员角色绑定关系管理 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2021-05-31 |
|||
*/ |
|||
@Service |
|||
public class VaccinationUserRoleServiceImpl extends BaseVimCurdServiceImpl<VaccinationUserRoleDao, VaccinationUserRoleEntity, VaccinationUserRoleDTO> implements VaccinationUserRoleService { |
|||
|
|||
@Override |
|||
public QueryWrapper<VaccinationUserRoleEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<VaccinationUserRoleEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PageData<VaccinationUserRoleDTO> page(Map<String, Object> params) { |
|||
IPage<VaccinationUserRoleEntity> page = getPage(params, FieldConstant.CREATED_TIME, false); |
|||
List<VaccinationUserRoleDTO> list = baseDao.getList(params); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(VaccinationUserRoleDTO dto) { |
|||
List<VaccinationUserRoleDTO> checkExist = baseDao.selectByUserId(dto.getUserId()); |
|||
if (!checkExist.isEmpty()) { |
|||
throw new RenException("该用户已经授权"); |
|||
} |
|||
List<Long> roleIds = dto.getRoleIds(); |
|||
roleIds.forEach(roleId -> { |
|||
VaccinationUserRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationUserRoleEntity.class); |
|||
entity.setRoleId(roleId); |
|||
insert(entity); |
|||
}); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(VaccinationUserRoleDTO dto) { |
|||
baseDao.deleteByUserId(dto.getUserId()); |
|||
List<Long> roleIds = dto.getRoleIds(); |
|||
roleIds.forEach(roleId -> { |
|||
VaccinationUserRoleEntity entity = ConvertUtils.sourceToTarget(dto, VaccinationUserRoleEntity.class); |
|||
entity.setRoleId(roleId); |
|||
insert(entity); |
|||
}); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(Long[] ids) { |
|||
VaccinationUserRoleEntity entity = selectById(ids[0]); |
|||
baseDao.deleteByUserId(entity.getUserId()); |
|||
} |
|||
|
|||
@Override |
|||
public VaccinationAuthDTO getVaccinationAuth(Long userId) { |
|||
VaccinationAuthDTO vaccinationAuthDTO = new VaccinationAuthDTO(); |
|||
UserDetail user = SecurityUser.getUser(); |
|||
if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { |
|||
return vaccinationAuthDTO; |
|||
} |
|||
|
|||
List<VaccinationRoleDTO> roleList = baseDao.selectRoleByUserId(userId); |
|||
if (!roleList.isEmpty()) { |
|||
List<String> countyKeywords = new ArrayList<>(); |
|||
List<String> streetKeywords = new ArrayList<>(); |
|||
List<String> communityKeywords = new ArrayList<>(); |
|||
List<String> gridKeywords = new ArrayList<>(); |
|||
roleList.forEach(role -> { |
|||
countyKeywords.addAll(Arrays.asList(role.getCountyKeywords().split(","))); |
|||
streetKeywords.addAll(Arrays.asList(role.getStreetKeywords().split(","))); |
|||
communityKeywords.addAll(Arrays.asList(role.getCommunityKeywords().split(","))); |
|||
gridKeywords.addAll(Arrays.asList(role.getGridKeywords().split(","))); |
|||
}); |
|||
|
|||
// 去重去空
|
|||
vaccinationAuthDTO.setCountyKeywords(countyKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); |
|||
vaccinationAuthDTO.setStreetKeywords(streetKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); |
|||
vaccinationAuthDTO.setCommunityKeywords(communityKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); |
|||
vaccinationAuthDTO.setGridKeywords(gridKeywords.stream().distinct().collect(Collectors.toList()).stream().filter(string -> !string.isEmpty()).collect(Collectors.toList())); |
|||
} |
|||
return vaccinationAuthDTO; |
|||
} |
|||
|
|||
@Override |
|||
public Map<String, Object> getVaccinationAuthParams(Long userId) { |
|||
Map<String, Object> map = new HashMap<>(4); |
|||
UserDetail user = SecurityUser.getUser(); |
|||
if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { |
|||
return map; |
|||
} |
|||
|
|||
VaccinationAuthDTO dto = getVaccinationAuth(userId); |
|||
|
|||
if (!dto.getCountyKeywords().isEmpty()) { |
|||
map.put("countyKeywords", dto.getCountyKeywords()); |
|||
} else { |
|||
map.put("countyKeywords", null); |
|||
} |
|||
if (!dto.getStreetKeywords().isEmpty()) { |
|||
map.put("streetKeywords", dto.getStreetKeywords()); |
|||
} else { |
|||
map.put("streetKeywords", null); |
|||
} |
|||
if (!dto.getCommunityKeywords().isEmpty()) { |
|||
map.put("communityKeywords", dto.getCommunityKeywords()); |
|||
} else { |
|||
map.put("communityKeywords", null); |
|||
} |
|||
if (!dto.getGridKeywords().isEmpty()) { |
|||
map.put("gridKeywords", dto.getGridKeywords()); |
|||
} else { |
|||
map.put("gridKeywords", null); |
|||
} |
|||
return map; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
<?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.elink.esua.epdc.vaccine.vim.dao.VaccinationRoleDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.vaccine.vim.entity.VaccinationRoleEntity" id="vaccinationRoleMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="roleName" column="ROLE_NAME"/> |
|||
<result property="countyKeywords" column="COUNTY_KEYWORDS"/> |
|||
<result property="streetKeywords" column="STREET_KEYWORDS"/> |
|||
<result property="communityKeywords" column="COMMUNITY_KEYWORDS"/> |
|||
<result property="gridKeywords" column="GRID_KEYWORDS"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,66 @@ |
|||
<?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.elink.esua.epdc.vaccine.vim.dao.VaccinationUserRoleDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.vaccine.vim.entity.VaccinationUserRoleEntity" id="vaccinationUserRoleMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="roleId" column="ROLE_ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="getList" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO"> |
|||
SELECT |
|||
ur.*, u.real_name AS userName, |
|||
group_concat(r.ROLE_NAME) AS roleNames |
|||
FROM |
|||
vaccination_user_role ur |
|||
INNER JOIN sys_user u ON u.id = ur.USER_ID |
|||
INNER JOIN vaccination_role r ON r.id = ur.ROLE_ID |
|||
WHERE |
|||
ur.DEL_FLAG = '0' |
|||
AND u.del_flag = '0' |
|||
AND r.DEL_FLAG = '0' |
|||
<if test="userName != null and userName != ''"> |
|||
AND u.REAL_NAME LIKE concat('%', #{userName}, '%') |
|||
</if> |
|||
GROUP BY |
|||
ur.USER_ID |
|||
</select> |
|||
|
|||
<delete id="deleteByUserId"> |
|||
DELETE |
|||
FROM |
|||
vaccination_user_role |
|||
WHERE |
|||
user_id = #{userId} |
|||
</delete> |
|||
<select id="selectByUserId" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationUserRoleDTO"> |
|||
SELECT * |
|||
FROM |
|||
vaccination_user_role |
|||
WHERE |
|||
user_id = #{userId} |
|||
</select> |
|||
<select id="selectRoleByUserId" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationRoleDTO"> |
|||
SELECT |
|||
r.id, |
|||
r.ROLE_NAME, |
|||
IFNULL(COUNTY_KEYWORDS, '') AS COUNTY_KEYWORDS, |
|||
IFNULL(STREET_KEYWORDS, '') AS STREET_KEYWORDS, |
|||
IFNULL(COMMUNITY_KEYWORDS, '') AS COMMUNITY_KEYWORDS, |
|||
IFNULL(GRID_KEYWORDS, '') AS GRID_KEYWORDS, |
|||
REMARK |
|||
FROM |
|||
vaccination_user_role ur |
|||
LEFT JOIN vaccination_role r ON r.id = ur.ROLE_ID |
|||
WHERE |
|||
ur.user_id = #{userId} |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue