Browse Source

Merge remote-tracking branch 'origin/feature/phaseOne' into feature/appletsModify

origin/epidemic_user
zhangyongzhangyong 4 years ago
parent
commit
3bc22bf76c
  1. 109
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/TestingPointController.java
  2. 13
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/PersonTestingDao.java
  3. 68
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/TestingPointDao.java
  4. 6
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/PersonTestingEntity.java
  5. 76
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/TestingPointEntity.java
  6. 75
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/TestingPointExcel.java
  7. 47
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/redis/TestingPointRedis.java
  8. 106
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/TestingPointService.java
  9. 5
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java
  10. 106
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/TestingPointServiceImpl.java
  11. 25
      epdc-cloud-custom/src/main/resources/mapper/epidemic/PersonTestingDao.xml
  12. 69
      epdc-cloud-custom/src/main/resources/mapper/epidemic/TestingPointDao.xml

109
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/TestingPointController.java

@ -0,0 +1,109 @@
/**
* 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.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.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.epidemic.TestingPointDTO;
import com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO;
import com.elink.esua.epdc.modules.epidemic.excel.TestingPointExcel;
import com.elink.esua.epdc.modules.epidemic.service.TestingPointService;
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 2021-09-09
*/
@RestController
@RequestMapping("testingpoint")
public class TestingPointController {
@Autowired
private TestingPointService testingPointService;
@GetMapping("page")
public Result<PageData<TestingPointDTO>> page(@RequestParam Map<String, Object> params){
PageData<TestingPointDTO> page = testingPointService.page(params);
return new Result<PageData<TestingPointDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<TestingPointDTO> get(@PathVariable("id") String id){
TestingPointDTO data = testingPointService.get(id);
return new Result<TestingPointDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody TestingPointDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
testingPointService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody TestingPointDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
testingPointService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
testingPointService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<TestingPointDTO> list = testingPointService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, TestingPointExcel.class);
}
/**
* 下拉选择 监测点
*
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO>>
* @Author zhangyong
* @Date 09:39 2021-09-10
**/
@GetMapping("testingPointSelection")
public Result<List<TestingPointSelectionResultDTO>> testingPointSelection(){
List<TestingPointSelectionResultDTO> data = testingPointService.getTestingPointSelector();
return new Result<List<TestingPointSelectionResultDTO>>().ok(data);
}
}

13
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/PersonTestingDao.java

@ -18,6 +18,7 @@
package com.elink.esua.epdc.modules.epidemic.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PersonTestingDTO;
import com.elink.esua.epdc.dto.PersonTestingPageDTO;
import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity;
import org.apache.ibatis.annotations.Mapper;
@ -45,4 +46,14 @@ public interface PersonTestingDao extends BaseDao<PersonTestingEntity> {
* @return java.lang.String
*/
String getMobileByIdCard(@Param("idcard") String idcard);
}
/**
* 详情查询
* @param id
* @return com.elink.esua.epdc.dto.PersonTestingDTO
* @Author zhangyong
* @Date 11:04 2021-09-10
**/
PersonTestingDTO getDetailPersonTesting(@Param("id") String id);
}

68
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/TestingPointDao.java

@ -0,0 +1,68 @@
/**
* 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.epidemic.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.epidemic.TestingPointDTO;
import com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO;
import com.elink.esua.epdc.modules.epidemic.entity.TestingPointEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
@Mapper
public interface TestingPointDao extends BaseDao<TestingPointEntity> {
/**
* 下拉选择 监测点
*
* @param
* @return java.util.List<com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO>
* @Author zhangyong
* @Date 09:39 2021-09-10
**/
List<TestingPointSelectionResultDTO> getTestingPointSelector();
/**
* 监测点列表查询
*
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.epidemic.TestingPointDTO>
* @Author zhangyong
* @Date 09:45 2021-09-10
**/
List<TestingPointDTO> selectListTestingPoint(Map<String, Object> params);
/**
* 详情查询
*
* @param id
* @return com.elink.esua.epdc.dto.epidemic.TestingPointDTO
* @Author zhangyong
* @Date 13:30 2021-09-10
**/
TestingPointDTO getDetailTestingPoint(@Param("id") String id);
}

6
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/PersonTestingEntity.java

@ -98,4 +98,8 @@ public class PersonTestingEntity extends BaseEpdcEntity {
*/
private Date testingTime;
}
/**
* 核酸检测点表主键
*/
private String testingPointId;
}

76
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/TestingPointEntity.java

@ -0,0 +1,76 @@
/**
* 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.epidemic.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_testing_point")
public class TestingPointEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 监测点名称
*/
private String testingPointName;
/**
* 位置
*/
private String address;
/**
* 经度
*/
private BigDecimal longitude;
/**
* 纬度
*/
private BigDecimal latitude;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String tel;
/**
* 监测点介绍
*/
private String introduce;
}

75
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/TestingPointExcel.java

@ -0,0 +1,75 @@
/**
* 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.epidemic.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
@Data
public class TestingPointExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "监测点名称")
private String testingPointName;
@Excel(name = "位置")
private String address;
@Excel(name = "经度")
private BigDecimal longitude;
@Excel(name = "纬度")
private BigDecimal latitude;
@Excel(name = "负责人")
private String contacts;
@Excel(name = "联系电话")
private String tel;
@Excel(name = "逻辑删除标识")
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;
}

47
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/redis/TestingPointRedis.java

@ -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.epidemic.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
@Component
public class TestingPointRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

106
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/TestingPointService.java

@ -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.modules.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.dto.epidemic.TestingPointDTO;
import com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO;
import com.elink.esua.epdc.modules.epidemic.entity.TestingPointEntity;
import java.util.List;
import java.util.Map;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
public interface TestingPointService extends BaseService<TestingPointEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<TestingPointDTO>
* @author generator
* @date 2021-09-09
*/
PageData<TestingPointDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<TestingPointDTO>
* @author generator
* @date 2021-09-09
*/
List<TestingPointDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return TestingPointDTO
* @author generator
* @date 2021-09-09
*/
TestingPointDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-09
*/
void save(TestingPointDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-09
*/
void update(TestingPointDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-09
*/
void delete(String[] ids);
/**
* 下拉选择 监测点
*
* @param
* @return java.util.List<com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO>
* @Author zhangyong
* @Date 09:39 2021-09-10
**/
List<TestingPointSelectionResultDTO> getTestingPointSelector();
}

5
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java

@ -96,8 +96,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
@Override
public PersonTestingDTO get(String id) {
PersonTestingEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PersonTestingDTO.class);
return baseDao.getDetailPersonTesting(id);
}
@Override
@ -267,4 +266,4 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
}
}
}

106
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/TestingPointServiceImpl.java

@ -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.modules.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.dto.epidemic.TestingPointDTO;
import com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO;
import com.elink.esua.epdc.modules.epidemic.dao.TestingPointDao;
import com.elink.esua.epdc.modules.epidemic.entity.TestingPointEntity;
import com.elink.esua.epdc.modules.epidemic.redis.TestingPointRedis;
import com.elink.esua.epdc.modules.epidemic.service.TestingPointService;
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 java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 核酸检测点
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-09
*/
@Service
public class TestingPointServiceImpl extends BaseServiceImpl<TestingPointDao, TestingPointEntity> implements TestingPointService {
@Autowired
private TestingPointRedis testingPointRedis;
@Override
public PageData<TestingPointDTO> page(Map<String, Object> params) {
IPage<TestingPointDTO> page = getPage(params);
List<TestingPointDTO> list = baseDao.selectListTestingPoint(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<TestingPointDTO> list(Map<String, Object> params) {
List<TestingPointEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, TestingPointDTO.class);
}
private QueryWrapper<TestingPointEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<TestingPointEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public TestingPointDTO get(String id) {
return baseDao.getDetailTestingPoint(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(TestingPointDTO dto) {
TestingPointEntity entity = ConvertUtils.sourceToTarget(dto, TestingPointEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(TestingPointDTO dto) {
TestingPointEntity entity = ConvertUtils.sourceToTarget(dto, TestingPointEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<TestingPointSelectionResultDTO> getTestingPointSelector() {
return baseDao.getTestingPointSelector();
}
}

25
epdc-cloud-custom/src/main/resources/mapper/epidemic/PersonTestingDao.xml

@ -22,6 +22,7 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="testingPointId" column="TESTING_POINT_ID"/>
</resultMap>
<select id="getTestingPage" resultType="com.elink.esua.epdc.dto.PersonTestingPageDTO">
select *
@ -48,5 +49,27 @@
order by CREATED_TIME desc limit 1
</select>
<select id="getDetailPersonTesting" resultType="com.elink.esua.epdc.dto.PersonTestingDTO">
SELECT
person.ID,
person.`NAME`,
person.SEX,
person.NATION,
person.BIRTHDAY,
person.MOBILE,
person.ADDRESS,
person.IDCARD,
person.ORGAN,
person.IMG_CODE,
person.IMG_URL,
person.TESTING_RESULT,
person.TESTING_TIME,
person.TESTING_POINT_ID,
point.TESTING_POINT_NAME
FROM epdc_person_testing person
LEFT JOIN epdc_testing_point point ON point.ID = person.TESTING_POINT_ID AND point.DEL_FLAG = '0'
WHERE person.DEL_FLAG ='0'
AND person.ID = #{id}
</select>
</mapper>
</mapper>

69
epdc-cloud-custom/src/main/resources/mapper/epidemic/TestingPointDao.xml

@ -0,0 +1,69 @@
<?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.epidemic.dao.TestingPointDao">
<resultMap type="com.elink.esua.epdc.modules.epidemic.entity.TestingPointEntity" id="testingPointMap">
<result property="id" column="ID"/>
<result property="testingPointName" column="TESTING_POINT_NAME"/>
<result property="address" column="ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="contacts" column="CONTACTS"/>
<result property="tel" column="TEL"/>
<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="introduce" column="INTRODUCE"/>
</resultMap>
<select id="getTestingPointSelector" resultType="com.elink.esua.epdc.dto.epidemic.result.TestingPointSelectionResultDTO">
SELECT
ID tagValue,
TESTING_POINT_NAME tagName
FROM epdc_testing_point
WHERE DEL_FLAG = '0'
</select>
<select id="selectListTestingPoint" resultType="com.elink.esua.epdc.dto.epidemic.TestingPointDTO">
SELECT
point.ID,
point.TESTING_POINT_NAME,
point.ADDRESS,
point.LONGITUDE,
point.LATITUDE,
point.CONTACTS,
point.TEL,
point.INTRODUCE,
COUNT(person.ID) testNum
FROM epdc_testing_point point
LEFT JOIN epdc_person_testing person ON point.ID = person.TESTING_POINT_ID AND person.DEL_FLAG ='0'
WHERE point.DEL_FLAG = '0'
<if test="testingPointName != null and testingPointName != ''">
AND point.TESTING_POINT_NAME LIKE CONCAT('%', #{testingPointName}, '%')
</if>
GROUP BY point.ID
ORDER BY COUNT(person.ID) DESC, point.CREATED_TIME
</select>
<select id="getDetailTestingPoint" resultType="com.elink.esua.epdc.dto.epidemic.TestingPointDTO">
SELECT
point.ID,
point.TESTING_POINT_NAME,
point.ADDRESS,
point.LONGITUDE,
point.LATITUDE,
point.CONTACTS,
point.TEL,
point.INTRODUCE,
COUNT(person.ID) testNum
FROM epdc_testing_point point
LEFT JOIN epdc_person_testing person ON point.ID = person.TESTING_POINT_ID AND person.DEL_FLAG ='0'
WHERE point.DEL_FLAG = '0'
AND point.ID = #{id}
GROUP BY point.ID
</select>
</mapper>
Loading…
Cancel
Save