Browse Source

重构国际化,系统设备轨迹接口开发

master
caojianbin 8 months ago
parent
commit
5ac236eb6a
  1. 44
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/TemperatureDetailController.java
  2. 74
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/TemperatureDetail.java
  3. 31
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/TempPage.java
  4. 40
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceAlarmDto.java
  5. 28
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/dto/TotalTypeDto.java
  6. 15
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/dto/TrackDTO.java
  7. 13
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/TrackVO.java
  8. 38
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/TreeNode.java
  9. 28
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/TemperatureDetailMapper.java
  10. 16
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/TemperatureConfigService.java
  11. 28
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/TemperatureDetailService.java
  12. 45
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserService.java
  13. 20
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/TemperatureConfigServiceImpl.java
  14. 39
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/TemperatureDetailServiceImpl.java
  15. 95
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserServiceImpl.java
  16. 68
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/TreeUtil.java
  17. 21
      ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/TemperatureConfigMapper.xml
  18. 31
      ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/TemperatureDetailMapper.xml

44
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/TemperatureDetailController.java

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
package com.ecell.internationalize.system.controller;
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil;
import com.ecell.internationalize.common.core.web.domain.AjaxResult;
import com.ecell.internationalize.common.system.constant.FieldConstant;
import com.ecell.internationalize.system.service.HeartTemperatureRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author liy
* @since 2022-07-11
*/
@Api(value="设备体温",tags={"设备体温接口"})
@RestController
@RequestMapping("/temperature_detail")
public class TemperatureDetailController {
@Autowired
private HeartTemperatureRecordService heartTemperatureRecordService;
/**
* 设备体温条件分页查询
* @Author liy
* @Date 2022/7/11 15:38
* @param map 分页条件查询体
* @Return AjaxResult
*/
@ApiOperation("条件分页查询设备体温")
@PostMapping("temperature/detail/list")
public AjaxResult queryAll(@RequestBody Map<String,Object> map){
map.put("type","2");
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),heartTemperatureRecordService.findAllByPage(map));
}
}

74
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/TemperatureDetail.java

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
package com.ecell.internationalize.system.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author liy
* @since 2022-07-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("temperature_detail")
public class TemperatureDetail{
private static final long serialVersionUID=1L;
/**
* 主键Id
*/
@TableId("id")
private String id;
/**
* 设备iMei
*/
@TableField("i_mei")
private String mei;
/**
* 体温数据
*/
private Double temperature;
/**
* 姓名
*/
@TableField(exist = false)
private String name;
/**
* 创建人
*/
private String createUser;
/**
* 创建时间
*/
@TableField(value = "create_time",fill = FieldFill.INSERT)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 修改人
*/
private String updateUser;
/**
* 修改时间
*/
@TableField(value = "update_time",fill = FieldFill.UPDATE)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}

31
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/TempPage.java

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
package com.ecell.internationalize.system.entity.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Title: ApiOutwardPage
* @Author: liy
* @Date: 2023/3/8 14:56
* @Description:
* @Version:1.0
*/
@Data
public class TempPage {
@ApiModelProperty(example = "设备IMEI")
private String imei;
@ApiModelProperty(example = "开始日期")
private String startDate;
@ApiModelProperty(example = "结束日期")
private String endDate;
// @ApiModelProperty(example = "每页展示的条数")
// private Integer pageSize;
//
// @ApiModelProperty(example = "当前的页码")
// private Integer current;
}

40
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceAlarmDto.java

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
package com.ecell.internationalize.system.entity.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 闹钟设置表
* </p>
*
* @author liy
* @since 2022-09-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UpdateDeviceAlarmDto implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(example = "主键Id")
private String id;
@ApiModelProperty(example = "标签")
private String tag;
@ApiModelProperty(example = "响铃时间")
private String alarmTime;
@ApiModelProperty(example = "重复星期数为'0', '1'组成的7位长度字符串, 表示周一至周日是否有效,eg: '0000011'为周六日有效, '1110000'为周一二三有效")
private String alarmWeek;
@ApiModelProperty(example = "设备imei")
private String imei;
}

28
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/dto/TotalTypeDto.java

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
package com.ecell.internationalize.system.entity.dto;
import com.ecell.internationalize.common.system.entity.VersionRatioHistory;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Title: TotalTypeDto
* @Author: liy
* @Date: 2022/11/2 15:24
* @Description:
* @Version:1.0
*/
@Data
public class TotalTypeDto {
@ApiModelProperty(example = "统计类型(1:注册总数,2:今日注册数,3:今日活跃数,4:前一个月用户活跃数,5:前一个月每天的注册数)")
private String type;
@ApiModelProperty(example="数量")
private Integer total;
@ApiModelProperty(example="历史用户活跃数(type为4时存在该值)")
private List<VersionRatioHistory> list;
@ApiModelProperty(example="前一个月每天的注册数(type为5时存在该值)")
private List<RegisterDto> registerList;
}

15
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/dto/TrackDTO.java

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
package com.ecell.internationalize.system.entity.dto;
import lombok.Data;
/**
* @author borui
*/
@Data
public class TrackDTO {
private String imei;
private String start;
private String firmId;
private String agentId;
}

13
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/TrackVO.java

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
package com.ecell.internationalize.system.entity.vo;
import lombok.Data;
/**
* @author borui
*/
@Data
public class TrackVO {
private String imei;
private String longitude;
private String latitude;
}

38
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/vo/TreeNode.java

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
package com.ecell.internationalize.system.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Title: TreeNode
* @Author: liy
* @Date: 2022/7/19 9:20
* @Description:
* @Version:1.0
*/
@Data
@ApiModel(value = "树形节点")
public class TreeNode {
@ApiModelProperty(value = "当前节点id")
protected String id;
@ApiModelProperty(value = "父节点id")
protected String parentId;
@ApiModelProperty(value = "子节点列表")
protected List<TreeNode> children ;
/**
* 是否包含子节点
*
* @since 3.7
*/
private Boolean hasChildren;
public void add(TreeNode node) {
children.add(node);
}
}

28
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/TemperatureDetailMapper.java

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
package com.ecell.internationalize.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ecell.internationalize.system.entity.TemperatureDetail;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author liy
* @since 2022-07-11
*/
public interface TemperatureDetailMapper extends BaseMapper<TemperatureDetail> {
/**
* 体温条件分页查询
* @Author liy
* @Date 2022/7/11 15:42
* @param page 分页
* @param map 查询条件
* @return Page
*/
Page<TemperatureDetail> getList(@Param("page") Page<TemperatureDetail> page, @Param("map") Map<String, Object> map);
}

16
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/TemperatureConfigService.java

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
package com.ecell.internationalize.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ecell.internationalize.system.entity.TemperatureConfig;
/**
* <p>
* 服务类
* </p>
*
* @author liy
* @since 2022-07-11
*/
public interface TemperatureConfigService extends IService<TemperatureConfig> {
}

28
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/TemperatureDetailService.java

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
package com.ecell.internationalize.system.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ecell.internationalize.system.entity.TemperatureDetail;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author liy
* @since 2022-07-11
*/
public interface TemperatureDetailService extends IService<TemperatureDetail> {
/**
* 设备体温条件分页查询
* @Author liy
* @Date 2022/7/11 15:42
* @param map 分页查询体
* @return IPage
*/
IPage<TemperatureDetail> findAllByPage(Map<String, Object> map);
}

45
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserService.java

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
package com.ecell.internationalize.system.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ecell.internationalize.common.system.entity.User;
import com.ecell.internationalize.common.system.entity.VersionRatioHistory;
import com.ecell.internationalize.system.entity.dto.RegisterDto;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 用户 服务类
* </p>
* @author liy
* @since 2022-07-07
*/
public interface UserService extends IService<User> {
/**
* 用户信息条件分页查询
* @Author liy
* @Date 2022/7/7 16:42
* @param map 分页查询体
* @return IPage
*/
IPage<User> queryList(Map<String,Object> map);
/**
* 用户操作条件分页查询
* @Author liy
* @Date 2022/7/8 16:42
* @param map 分页查询体
* @return IPage
*/
IPage<User> queryOperatorList(Map<String,Object> map);
List<String> queryChannel();
int activeCount(Date startTime, Date endTime);
List<VersionRatioHistory> monthActiveCount(String currentDate, String preMonthDate);
List<RegisterDto> monthRegisterCount(String currentDate, String preMonthDate);
}

20
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/TemperatureConfigServiceImpl.java

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
package com.ecell.internationalize.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ecell.internationalize.system.entity.TemperatureConfig;
import com.ecell.internationalize.system.mapper.TemperatureConfigMapper;
import com.ecell.internationalize.system.service.TemperatureConfigService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author liy
* @since 2022-07-11
*/
@Service
public class TemperatureConfigServiceImpl extends ServiceImpl<TemperatureConfigMapper, TemperatureConfig> implements TemperatureConfigService {
}

39
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/TemperatureDetailServiceImpl.java

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
package com.ecell.internationalize.system.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ecell.internationalize.common.system.constant.FieldConstant;
import com.ecell.internationalize.system.entity.TemperatureDetail;
import com.ecell.internationalize.system.mapper.TemperatureDetailMapper;
import com.ecell.internationalize.system.service.TemperatureDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* <p>
* 服务实现类
* </p>
*
* @author liy
* @since 2022-07-11
*/
@Service
public class TemperatureDetailServiceImpl extends ServiceImpl<TemperatureDetailMapper, TemperatureDetail> implements TemperatureDetailService {
@Autowired
private TemperatureDetailMapper temperatureDetailMapper;
/**
* 设备体温条件分页查询
* @Author liy
* @Date 2022/7/11 15:42
* @param map 分页查询体
* @return IPage
*/
@Override
public IPage<TemperatureDetail> findAllByPage(Map<String, Object> map) {
Page<TemperatureDetail> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString()));
return temperatureDetailMapper.getList(page,map);
}
}

95
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserServiceImpl.java

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
package com.ecell.internationalize.system.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ecell.internationalize.common.system.constant.FieldConstant;
import com.ecell.internationalize.common.system.entity.User;
import com.ecell.internationalize.common.system.entity.VersionRatioHistory;
import com.ecell.internationalize.system.entity.dto.RegisterDto;
import com.ecell.internationalize.system.mapper.UserMapper;
import com.ecell.internationalize.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 用户 服务实现类
* </p>
* @author liy
* @since 2022-07-07
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Autowired
private UserMapper userMapper;
/**
* 用户信息条件分页查询
* @Author liy
* @Date 2022/7/7 16:42
* @param map 分页查询体
* @return IPage
*/
@Override
public IPage<User> queryList(Map<String,Object> map) {
Page<User> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString()));
return userMapper.getList(page, map);
}
/**
* 用户操作条件分页查询
* @Author liy
* @Date 2022/7/8 16:42
* @param map 分页查询体
* @return IPage
*/
@Override
public IPage<User> queryOperatorList(Map<String, Object> map) {
Page<User> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString()));
return userMapper.getList(page, map);
}
@Override
public List<String> queryChannel() {
return userMapper.queryChannel();
}
@Override
public int activeCount(Date startTime, Date endTime) {
return userMapper.activeCount(startTime,endTime);
}
@Override
public List<VersionRatioHistory> monthActiveCount(String currentDate, String preMonthDate) {
return userMapper.monthActiveCount(currentDate,preMonthDate);
}
@Override
public List<RegisterDto> monthRegisterCount(String currentDate, String preMonthDate) {
return userMapper.monthRegisterCount(currentDate,preMonthDate);
}
/**
* 多条件查询
* @Author: liy
* @Date: 2022/7/8 17:39
*/
// private LambdaQueryWrapper<User> conditionMap(Map<String,Object> map){
// LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
// if (map.containsKey(FieldConstant.PHONE)&&null!=map.get(FieldConstant.PHONE).toString()){
// queryWrapper.eq(User::getPhone,map.get(FieldConstant.PHONE).toString());
// }
// if (map.containsKey(FieldConstant.I_MEI)&&null!=map.get(FieldConstant.I_MEI).toString()){
// queryWrapper.eq(User::getIMei,map.get(FieldConstant.I_MEI).toString());
// }
// if (map.containsKey(FieldConstant.CHANNEL)&&null!=map.get(FieldConstant.CHANNEL).toString()){
// queryWrapper.eq(User::getChannel,map.get(FieldConstant.CHANNEL).toString());
// }
// if (map.containsKey(FieldConstant.STATUS)&&null!=map.get(FieldConstant.STATUS).toString()){
// queryWrapper.eq(User::getStatus,map.get(FieldConstant.STATUS).toString());
// }
// return queryWrapper;
// }
}

68
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/TreeUtil.java

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
package com.ecell.internationalize.system.utils;
import com.ecell.internationalize.system.entity.FirmManage;
import com.ecell.internationalize.system.entity.vo.FirmTree;
import com.ecell.internationalize.system.entity.vo.TreeNode;
import lombok.experimental.UtilityClass;
import java.util.ArrayList;
import java.util.List;
/**
* @Title: TreeUtil
* @Author: liy
* @Date: 2022/7/19 9:16
* @Description:
* @Version:1.0
*/
@UtilityClass
public class TreeUtil {
/**
* 两层循环实现建树
* @param treeNodes 传入的树节点列表
* @return
*/
public <T extends TreeNode> List<T> build(List<T> treeNodes, Object root) {
List<T> trees = new ArrayList<>();
for (T treeNode : treeNodes) {
if (root.equals(treeNode.getParentId())) {
trees.add(treeNode);
}
for (T it : treeNodes) {
if (it.getParentId().equals(treeNode.getId())) {
if (treeNode.getChildren() == null) {
treeNode.setChildren(new ArrayList<>());
}
//treeNode.setHasChildren(true);
treeNode.add(it);
}
}
}
return trees;
}
/**
* 通过FirmManage创建树形节点
* @param firmManages
* @param root
* @return
*/
public List<FirmTree> buildFirmTree(List<FirmManage> firmManages, String root) {
List<FirmTree> trees = new ArrayList<>();
FirmTree node;
for (FirmManage firmManage : firmManages) {
node = new FirmTree();
node.setId(firmManage.getFirmId());
node.setParentId(firmManage.getParentId());
node.setFirmName(firmManage.getFirmName());
node.setCreateTime(firmManage.getCreateTime());
node.setHasChildren(false);
trees.add(node);
}
return TreeUtil.build(trees, root);
}
}

21
ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/TemperatureConfigMapper.xml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?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.ecell.internationalize.system.mapper.TemperatureConfigMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.ecell.internationalize.system.entity.TemperatureConfig">
<id column="id" property="id" />
<result column="i_mei" property="mei" />
<result column="temperature_freq" property="temperatureFreq" />
<result column="last_temperature" property="lastTemperature" />
<result column="last_temperature_time" property="lastTemperatureTime" />
<result column="upper" property="upper" />
<result column="lower" property="lower" />
<result column="switch_on" property="switchOn" />
<result column="create_user" property="createUser" />
<result column="create_time" property="createTime" />
<result column="update_user" property="updateUser" />
<result column="update_time" property="updateTime" />
</resultMap>
</mapper>

31
ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/TemperatureDetailMapper.xml

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
<?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.ecell.internationalize.system.mapper.TemperatureDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.ecell.internationalize.system.entity.TemperatureDetail">
<id column="id" property="id" />
<result column="i_mei" property="mei" />
<result column="temperature" property="temperature" />
<result column="name" property="name"/>
<result column="create_user" property="createUser" />
<result column="create_time" property="createTime" />
<result column="update_user" property="updateUser" />
<result column="update_time" property="updateTime" />
</resultMap>
<select id="getList" resultMap="BaseResultMap">
select A.id,A.i_mei,A.temperature,A.create_user,A.create_time,A.update_user,A.update_time,B.name from
temperature_detail A left join user B ON A.i_mei=B.i_mei
where 1=1
<if test="map.iMei!=null and map.iMei!=''">
and A.i_mei=#{map.iMei}
</if>
<if test="map.startTime!=null">
<![CDATA[and DATE_FORMAT(A.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{map.startTime},'%Y-%m-%d')]]>
</if>
<if test="map.endTime!=null">
<![CDATA[and DATE_FORMAT(A.create_time,'%Y-%m-%d')<=DATE_FORMAT(#{map.endTime},'%Y-%m-%d')]]>
</if>
</select>
</mapper>
Loading…
Cancel
Save