12 changed files with 699 additions and 6 deletions
@ -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); |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
@ -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; |
||||
|
} |
@ -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; |
||||
|
|
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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(); |
||||
|
} |
@ -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(); |
||||
|
} |
||||
|
} |
@ -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…
Reference in new issue