18 changed files with 1071 additions and 272 deletions
@ -0,0 +1,94 @@ |
|||
/** |
|||
* 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.modules.police.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.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.police.PoliceDTO; |
|||
import com.elink.esua.epdc.modules.police.excel.PoliceExcel; |
|||
import com.elink.esua.epdc.modules.police.service.PoliceService; |
|||
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 2020-05-21 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("police") |
|||
public class PoliceController { |
|||
|
|||
@Autowired |
|||
private PoliceService policeService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<PoliceDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PoliceDTO> page = policeService.page(params); |
|||
return new Result<PageData<PoliceDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<PoliceDTO> get(@PathVariable("id") String id){ |
|||
PoliceDTO data = policeService.get(id); |
|||
return new Result<PoliceDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody PoliceDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
policeService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody PoliceDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
policeService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
policeService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PoliceDTO> list = policeService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PoliceExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
/** |
|||
* 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.modules.police.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.police.entity.PoliceEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 民警表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-05-21 |
|||
*/ |
|||
@Mapper |
|||
public interface PoliceDao extends BaseDao<PoliceEntity> { |
|||
/** |
|||
* 民警列表 |
|||
* |
|||
* @return java.util.List<com.elink.esua.epdc.dto.pr.PoliceEntity> |
|||
* @params [params] |
|||
* @author zhangyuan |
|||
* @since 2019/10/11 14:54 |
|||
*/ |
|||
List<PoliceEntity> selectListOfPolice(Map<String, Object> params); |
|||
} |
@ -0,0 +1,96 @@ |
|||
/** |
|||
* 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.modules.police.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 民警表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-05-21 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_police") |
|||
public class PoliceEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 民警名称 |
|||
*/ |
|||
private String policeName; |
|||
|
|||
/** |
|||
* 民警照片地址 |
|||
*/ |
|||
private String policeAvatar; |
|||
|
|||
/** |
|||
* 民警联系方式 |
|||
*/ |
|||
private String policeTel; |
|||
|
|||
/** |
|||
* 警号 |
|||
*/ |
|||
private String policeNo; |
|||
|
|||
/** |
|||
* 民警所在机构名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 民警所在机构id(此处存储社区id) |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 是否展示 0否 ,1是 |
|||
*/ |
|||
private String displayFlag; |
|||
|
|||
/** |
|||
* 所有部门ID |
|||
*/ |
|||
private String allDeptIds; |
|||
|
|||
/** |
|||
* 所有部门名称 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptIds; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptNames; |
|||
|
|||
} |
@ -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.modules.police.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 2020-05-21 |
|||
*/ |
|||
@Data |
|||
public class PoliceExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "民警名称") |
|||
private String policeName; |
|||
|
|||
@Excel(name = "民警照片地址") |
|||
private String policeAvatar; |
|||
|
|||
@Excel(name = "民警联系方式") |
|||
private String policeTel; |
|||
|
|||
@Excel(name = "警号") |
|||
private String policeNo; |
|||
|
|||
@Excel(name = "民警所在机构名称") |
|||
private String deptName; |
|||
|
|||
@Excel(name = "民警所在机构id(此处存储社区id)") |
|||
private Long deptId; |
|||
|
|||
@Excel(name = "是否展示 0否 ,1是") |
|||
private String displayFlag; |
|||
|
|||
@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; |
|||
|
|||
@Excel(name = "所有部门ID") |
|||
private String allDeptIds; |
|||
|
|||
@Excel(name = "所有部门名称") |
|||
private String allDeptNames; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptIds; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptNames; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* 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.modules.police.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 民警表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-05-21 |
|||
*/ |
|||
@Component |
|||
public class PoliceRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -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.modules.police.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.police.PoliceDTO; |
|||
import com.elink.esua.epdc.modules.police.entity.PoliceEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 民警表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-05-21 |
|||
*/ |
|||
public interface PoliceService extends BaseService<PoliceEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PoliceDTO> |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
PageData<PoliceDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PoliceDTO> |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
List<PoliceDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return PoliceDTO |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
PoliceDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
void save(PoliceDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
void update(PoliceDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-05-21 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,145 @@ |
|||
/** |
|||
* 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.modules.police.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.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dto.constant.GroupConstant; |
|||
import com.elink.esua.epdc.dto.enums.GroupStateEnum; |
|||
import com.elink.esua.epdc.dto.group.GroupListDTO; |
|||
import com.elink.esua.epdc.modules.group.dao.GroupDao; |
|||
import com.elink.esua.epdc.modules.group.entity.GroupEntity; |
|||
import com.elink.esua.epdc.modules.police.dao.PoliceDao; |
|||
import com.elink.esua.epdc.dto.police.PoliceDTO; |
|||
import com.elink.esua.epdc.modules.police.entity.PoliceEntity; |
|||
import com.elink.esua.epdc.modules.police.redis.PoliceRedis; |
|||
import com.elink.esua.epdc.modules.police.service.PoliceService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 民警表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-05-21 |
|||
*/ |
|||
@Service |
|||
public class PoliceServiceImpl extends BaseServiceImpl<PoliceDao, PoliceEntity> implements PoliceService { |
|||
|
|||
@Autowired |
|||
private PoliceRedis policeRedis; |
|||
|
|||
@Resource |
|||
private GroupDao groupDao; |
|||
|
|||
@Override |
|||
public PageData<PoliceDTO> page(Map<String, Object> params) { |
|||
IPage<PoliceEntity> page = getPage(params); |
|||
List<PoliceEntity> entityList = baseDao.selectListOfPolice(params); |
|||
List<PoliceDTO> list = ConvertUtils.sourceToTarget(entityList, PoliceDTO.class); |
|||
return new PageData<>(list, page.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public List<PoliceDTO> list(Map<String, Object> params) { |
|||
List<PoliceEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PoliceDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PoliceEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PoliceEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PoliceDTO get(String id) { |
|||
PoliceEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, PoliceDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(PoliceDTO dto) { |
|||
PoliceEntity entity = ConvertUtils.sourceToTarget(dto, PoliceEntity.class); |
|||
// TODO 冗余字段。
|
|||
insert(entity); |
|||
|
|||
List<GroupListDTO> groupList = groupDao.selectListOfGroupByDeptId(entity.getDeptId()); |
|||
if (groupList.size() == 0) { |
|||
// 创民警的同时创建群
|
|||
GroupEntity groupEntity = new GroupEntity(); |
|||
|
|||
// TODO 冗余字段。
|
|||
groupEntity.setReferenceBusinessId(entity.getId()); |
|||
groupEntity.setState(GroupStateEnum.GROUP_STATE_EXAMINATION_PASSED.getValue()); |
|||
groupEntity.setGroupAvatar(GroupConstant.PROPERTY_GROUP_AVATAR); |
|||
groupEntity.setGroupName(entity.getDeptName() + "警民群"); |
|||
groupEntity.setGroupCategory(GroupConstant.POLICE_GROUP_CATEGORY); |
|||
groupEntity.setGrid(entity.getDeptName()); |
|||
groupEntity.setGridId(entity.getDeptId()); |
|||
groupDao.insert(groupEntity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(PoliceDTO dto) { |
|||
PoliceEntity entity = ConvertUtils.sourceToTarget(dto, PoliceEntity.class); |
|||
updateById(entity); |
|||
|
|||
List<GroupListDTO> groupList = groupDao.selectListOfGroupByDeptId(entity.getDeptId()); |
|||
if (groupList.size() == 0) { |
|||
// 创民警的同时创建群
|
|||
GroupEntity groupEntity = new GroupEntity(); |
|||
|
|||
// TODO 冗余字段。
|
|||
groupEntity.setReferenceBusinessId(entity.getId()); |
|||
groupEntity.setState(GroupStateEnum.GROUP_STATE_EXAMINATION_PASSED.getValue()); |
|||
groupEntity.setGroupAvatar(GroupConstant.PROPERTY_GROUP_AVATAR); |
|||
groupEntity.setGroupName(entity.getDeptName() + "警民群"); |
|||
groupEntity.setGroupCategory(GroupConstant.POLICE_GROUP_CATEGORY); |
|||
groupEntity.setGrid(entity.getDeptName()); |
|||
groupEntity.setGridId(entity.getDeptId()); |
|||
groupDao.insert(groupEntity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
<?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.modules.police.dao.PoliceDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.police.entity.PoliceEntity" id="policeMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="policeName" column="POLICE_NAME"/> |
|||
<result property="policeAvatar" column="POLICE_AVATAR"/> |
|||
<result property="policeTel" column="POLICE_TEL"/> |
|||
<result property="policeNo" column="POLICE_NO"/> |
|||
<result property="deptName" column="DEPT_NAME"/> |
|||
<result property="deptId" column="DEPT_ID"/> |
|||
<result property="displayFlag" column="DISPLAY_FLAG"/> |
|||
<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"/> |
|||
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
|||
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
|||
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
|||
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
ID, POLICE_NAME, POLICE_AVATAR, POLICE_TEL, POLICE_NO, DEPT_ID, DEPT_NAME, |
|||
DISPLAY_FLAG CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, |
|||
ALL_DEPT_IDS, ALL_DEPT_NAMES, PARENT_DEPT_IDS, PARENT_DEPT_NAMES |
|||
</sql> |
|||
<select id="selectListOfPolice" resultType="com.elink.esua.epdc.modules.police.entity.PoliceEntity"> |
|||
SELECT |
|||
<include refid="Base_Column_List" /> |
|||
FROM |
|||
epdc_police ep |
|||
WHERE |
|||
ep.DEL_FLAG = '0' |
|||
<if test="policeName != null and policeName != ''"> |
|||
AND ep.POLICE_NAME like CONCAT( '%', #{policeName}, '%' ) |
|||
</if> |
|||
<if test="policeNo != null and policeNo != ''"> |
|||
AND ep.POLICE_NO like CONCAT( '%', #{policeNo}, '%' ) |
|||
</if> |
|||
<if test="deptId != null and deptId != ''"> |
|||
AND (ep.DEPT_ID = #{deptId} |
|||
OR find_in_set(#{deptId},ep.ALL_DEPT_IDS)) |
|||
</if> |
|||
ORDER BY |
|||
ep.CREATED_TIME DESC |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue