浏览代码

设备设置回显,开始结束日期修正

zhengjie 1 年之前
父节点
当前提交
d59c9f9e34

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TDeviceSetController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.TDeviceSet;
+import com.ruoyi.system.service.ITDeviceSetService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 设备设置Controller
+ * 
+ * @author zhengjie
+ * @date 2023-09-20
+ */
+@RestController
+@RequestMapping("/system/deviceset")
+public class TDeviceSetController extends BaseController
+{
+    @Autowired
+    private ITDeviceSetService tDeviceSetService;
+
+    /**
+     * 查询设备设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TDeviceSet tDeviceSet)
+    {
+        startPage();
+        List<TDeviceSet> list = tDeviceSetService.selectTDeviceSetList(tDeviceSet);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出设备设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:export')")
+    @Log(title = "设备设置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TDeviceSet tDeviceSet)
+    {
+        List<TDeviceSet> list = tDeviceSetService.selectTDeviceSetList(tDeviceSet);
+        ExcelUtil<TDeviceSet> util = new ExcelUtil<TDeviceSet>(TDeviceSet.class);
+        util.exportExcel(response, list, "设备设置数据");
+    }
+
+    /**
+     * 获取设备设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Integer id)
+    {
+        return success(tDeviceSetService.selectTDeviceSetById(id));
+    }
+
+    /**
+     * 新增设备设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:add')")
+    @Log(title = "设备设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TDeviceSet tDeviceSet)
+    {
+        return toAjax(tDeviceSetService.insertTDeviceSet(tDeviceSet));
+    }
+
+    /**
+     * 修改设备设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:edit')")
+    @Log(title = "设备设置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TDeviceSet tDeviceSet)
+    {
+        return toAjax(tDeviceSetService.updateTDeviceSet(tDeviceSet));
+    }
+
+    /**
+     * 删除设备设置
+     */
+    @PreAuthorize("@ss.hasPermi('system:deviceset:remove')")
+    @Log(title = "设备设置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Integer[] ids)
+    {
+        return toAjax(tDeviceSetService.deleteTDeviceSetByIds(ids));
+    }
+}

+ 331 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TDeviceSet.java

@@ -0,0 +1,331 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 设备设置对象 t_device_set
+ * 
+ * @author zhengjie
+ * @date 2023-09-20
+ */
+public class TDeviceSet extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Integer id;
+
+    /** 设置id编码 */
+    @Excel(name = "设置id编码")
+    private String deviceIdCode;
+
+    /** sos手机号1 */
+    @Excel(name = "sos手机号1")
+    private String sostelno1;
+
+    /** sos手机号2 */
+    @Excel(name = "sos手机号2")
+    private String sostelno2;
+
+    /** 定位间隔 */
+    @Excel(name = "定位间隔")
+    private String gpsInterval;
+
+    /** 心率间隔 */
+    @Excel(name = "心率间隔")
+    private String heartInterval;
+
+    /** 体温间隔 */
+    @Excel(name = "体温间隔")
+    private String bodyInterval;
+
+    /** 血压间隔 */
+    @Excel(name = "血压间隔")
+    private String bloodInterval;
+
+    /** 血氧间隔 */
+    @Excel(name = "血氧间隔")
+    private String oxygenInterval;
+
+    /** 计步器状态 */
+    @Excel(name = "计步器状态")
+    private Integer stepStatus;
+
+    /** 联系人1 */
+    @Excel(name = "联系人1")
+    private String contactPer1;
+
+    /** 联系人电话1 */
+    @Excel(name = "联系人电话1")
+    private String contactTel1;
+
+    /** 联系人2 */
+    @Excel(name = "联系人2")
+    private String contactPer2;
+
+    /** 联系人电话2 */
+    @Excel(name = "联系人电话2")
+    private String contactTel2;
+
+    /** 联系人3 */
+    @Excel(name = "联系人3")
+    private String contactPer3;
+
+    /** 联系人电话3 */
+    @Excel(name = "联系人电话3")
+    private String contactTel3;
+
+    /** 定时开关机使用状态 */
+    @Excel(name = "定时开关机使用状态")
+    private Integer timeStatus;
+
+    /** 开机时间 */
+    @Excel(name = "开机时间")
+    private String timeBegin;
+
+    /** 关机时间 */
+    @Excel(name = "关机时间")
+    private String timeEnd;
+
+    /** 佩戴使用状态 */
+    @Excel(name = "佩戴使用状态")
+    private Integer useStatus;
+
+    /** 跌倒状态 */
+    @Excel(name = "跌倒状态")
+    private Integer fallStatus;
+
+    /** 跌倒灵敏度 */
+    @Excel(name = "跌倒灵敏度")
+    private Integer levelStatus;
+
+    public void setId(Integer id) 
+    {
+        this.id = id;
+    }
+
+    public Integer getId() 
+    {
+        return id;
+    }
+    public void setDeviceIdCode(String deviceIdCode) 
+    {
+        this.deviceIdCode = deviceIdCode;
+    }
+
+    public String getDeviceIdCode() 
+    {
+        return deviceIdCode;
+    }
+    public void setSostelno1(String sostelno1) 
+    {
+        this.sostelno1 = sostelno1;
+    }
+
+    public String getSostelno1() 
+    {
+        return sostelno1;
+    }
+    public void setSostelno2(String sostelno2) 
+    {
+        this.sostelno2 = sostelno2;
+    }
+
+    public String getSostelno2() 
+    {
+        return sostelno2;
+    }
+    public void setGpsInterval(String gpsInterval) 
+    {
+        this.gpsInterval = gpsInterval;
+    }
+
+    public String getGpsInterval() 
+    {
+        return gpsInterval;
+    }
+    public void setHeartInterval(String heartInterval) 
+    {
+        this.heartInterval = heartInterval;
+    }
+
+    public String getHeartInterval() 
+    {
+        return heartInterval;
+    }
+    public void setBodyInterval(String bodyInterval) 
+    {
+        this.bodyInterval = bodyInterval;
+    }
+
+    public String getBodyInterval() 
+    {
+        return bodyInterval;
+    }
+    public void setBloodInterval(String bloodInterval) 
+    {
+        this.bloodInterval = bloodInterval;
+    }
+
+    public String getBloodInterval() 
+    {
+        return bloodInterval;
+    }
+    public void setOxygenInterval(String oxygenInterval) 
+    {
+        this.oxygenInterval = oxygenInterval;
+    }
+
+    public String getOxygenInterval() 
+    {
+        return oxygenInterval;
+    }
+    public void setStepStatus(Integer stepStatus) 
+    {
+        this.stepStatus = stepStatus;
+    }
+
+    public Integer getStepStatus() 
+    {
+        return stepStatus;
+    }
+    public void setContactPer1(String contactPer1) 
+    {
+        this.contactPer1 = contactPer1;
+    }
+
+    public String getContactPer1() 
+    {
+        return contactPer1;
+    }
+    public void setContactTel1(String contactTel1) 
+    {
+        this.contactTel1 = contactTel1;
+    }
+
+    public String getContactTel1() 
+    {
+        return contactTel1;
+    }
+    public void setContactPer2(String contactPer2) 
+    {
+        this.contactPer2 = contactPer2;
+    }
+
+    public String getContactPer2() 
+    {
+        return contactPer2;
+    }
+    public void setContactTel2(String contactTel2) 
+    {
+        this.contactTel2 = contactTel2;
+    }
+
+    public String getContactTel2() 
+    {
+        return contactTel2;
+    }
+    public void setContactPer3(String contactPer3) 
+    {
+        this.contactPer3 = contactPer3;
+    }
+
+    public String getContactPer3() 
+    {
+        return contactPer3;
+    }
+    public void setContactTel3(String contactTel3) 
+    {
+        this.contactTel3 = contactTel3;
+    }
+
+    public String getContactTel3() 
+    {
+        return contactTel3;
+    }
+    public void setTimeStatus(Integer timeStatus) 
+    {
+        this.timeStatus = timeStatus;
+    }
+
+    public Integer getTimeStatus() 
+    {
+        return timeStatus;
+    }
+    public void setTimeBegin(String timeBegin) 
+    {
+        this.timeBegin = timeBegin;
+    }
+
+    public String getTimeBegin() 
+    {
+        return timeBegin;
+    }
+    public void setTimeEnd(String timeEnd) 
+    {
+        this.timeEnd = timeEnd;
+    }
+
+    public String getTimeEnd() 
+    {
+        return timeEnd;
+    }
+    public void setUseStatus(Integer useStatus) 
+    {
+        this.useStatus = useStatus;
+    }
+
+    public Integer getUseStatus() 
+    {
+        return useStatus;
+    }
+    public void setFallStatus(Integer fallStatus) 
+    {
+        this.fallStatus = fallStatus;
+    }
+
+    public Integer getFallStatus() 
+    {
+        return fallStatus;
+    }
+    public void setLevelStatus(Integer levelStatus) 
+    {
+        this.levelStatus = levelStatus;
+    }
+
+    public Integer getLevelStatus() 
+    {
+        return levelStatus;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("deviceIdCode", getDeviceIdCode())
+            .append("sostelno1", getSostelno1())
+            .append("sostelno2", getSostelno2())
+            .append("gpsInterval", getGpsInterval())
+            .append("heartInterval", getHeartInterval())
+            .append("bodyInterval", getBodyInterval())
+            .append("bloodInterval", getBloodInterval())
+            .append("oxygenInterval", getOxygenInterval())
+            .append("stepStatus", getStepStatus())
+            .append("contactPer1", getContactPer1())
+            .append("contactTel1", getContactTel1())
+            .append("contactPer2", getContactPer2())
+            .append("contactTel2", getContactTel2())
+            .append("contactPer3", getContactPer3())
+            .append("contactTel3", getContactTel3())
+            .append("timeStatus", getTimeStatus())
+            .append("timeBegin", getTimeBegin())
+            .append("timeEnd", getTimeEnd())
+            .append("useStatus", getUseStatus())
+            .append("fallStatus", getFallStatus())
+            .append("levelStatus", getLevelStatus())
+            .toString();
+    }
+}

+ 8 - 10
ruoyi-system/src/main/java/com/ruoyi/system/domain/TServiceManage.java

@@ -49,14 +49,12 @@ public class TServiceManage extends BaseEntity
     private Integer serviceStatus;
 
     /** 开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date begintime;
+    @Excel(name = "开始时间")
+    private String begintime;
 
     /** 结束时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date endtime;
+    @Excel(name = "结束时间")
+    private String endtime;
 
     /** 周末服务 */
     @Excel(name = "周末服务")
@@ -197,21 +195,21 @@ public class TServiceManage extends BaseEntity
     {
         return serviceStatus;
     }
-    public void setBegintime(Date begintime) 
+    public void setBegintime(String begintime)
     {
         this.begintime = begintime;
     }
 
-    public Date getBegintime() 
+    public String getBegintime()
     {
         return begintime;
     }
-    public void setEndtime(Date endtime) 
+    public void setEndtime(String endtime)
     {
         this.endtime = endtime;
     }
 
-    public Date getEndtime() 
+    public String getEndtime()
     {
         return endtime;
     }

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDeviceSetMapper.java

@@ -0,0 +1,69 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.TDeviceSet;
+
+/**
+ * 设备设置Mapper接口
+ * 
+ * @author zhengjie
+ * @date 2023-09-20
+ */
+public interface TDeviceSetMapper 
+{
+    /**
+     * 查询设备设置
+     * 
+     * @param id 设备设置主键
+     * @return 设备设置
+     */
+    public TDeviceSet selectTDeviceSetById(Integer id);
+
+    /**
+     * 查询设备设置
+     *
+     * @param deviceIdCode 设备号
+     * @return 设备设置
+     */
+    public TDeviceSet selectTDeviceSetByCode(String deviceIdCode);
+
+    /**
+     * 查询设备设置列表
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 设备设置集合
+     */
+    public List<TDeviceSet> selectTDeviceSetList(TDeviceSet tDeviceSet);
+
+    /**
+     * 新增设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    public int insertTDeviceSet(TDeviceSet tDeviceSet);
+
+    /**
+     * 修改设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    public int updateTDeviceSet(TDeviceSet tDeviceSet);
+
+    /**
+     * 删除设备设置
+     * 
+     * @param id 设备设置主键
+     * @return 结果
+     */
+    public int deleteTDeviceSetById(Integer id);
+
+    /**
+     * 批量删除设备设置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTDeviceSetByIds(Integer[] ids);
+}

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ITDeviceSetService.java

@@ -0,0 +1,69 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.TDeviceSet;
+
+/**
+ * 设备设置Service接口
+ * 
+ * @author zhengjie
+ * @date 2023-09-20
+ */
+public interface ITDeviceSetService 
+{
+    /**
+     * 查询设备设置
+     * 
+     * @param id 设备设置主键
+     * @return 设备设置
+     */
+    public TDeviceSet selectTDeviceSetById(Integer id);
+
+    /**
+     * 查询设备设置
+     *
+     * @param deviceIdCode 设备号
+     * @return 设备设置
+     */
+    public TDeviceSet selectTDeviceSetByCode(String deviceIdCode);
+
+    /**
+     * 查询设备设置列表
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 设备设置集合
+     */
+    public List<TDeviceSet> selectTDeviceSetList(TDeviceSet tDeviceSet);
+
+    /**
+     * 新增设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    public int insertTDeviceSet(TDeviceSet tDeviceSet);
+
+    /**
+     * 修改设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    public int updateTDeviceSet(TDeviceSet tDeviceSet);
+
+    /**
+     * 批量删除设备设置
+     * 
+     * @param ids 需要删除的设备设置主键集合
+     * @return 结果
+     */
+    public int deleteTDeviceSetByIds(Integer[] ids);
+
+    /**
+     * 删除设备设置信息
+     * 
+     * @param id 设备设置主键
+     * @return 结果
+     */
+    public int deleteTDeviceSetById(Integer id);
+}

+ 111 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeviceSetServiceImpl.java

@@ -0,0 +1,111 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.TDeviceSetMapper;
+import com.ruoyi.system.domain.TDeviceSet;
+import com.ruoyi.system.service.ITDeviceSetService;
+
+/**
+ * 设备设置Service业务层处理
+ * 
+ * @author zhengjie
+ * @date 2023-09-20
+ */
+@Service
+public class TDeviceSetServiceImpl implements ITDeviceSetService 
+{
+    @Autowired
+    private TDeviceSetMapper tDeviceSetMapper;
+
+    /**
+     * 查询设备设置
+     * 
+     * @param id 设备设置主键
+     * @return 设备设置
+     */
+    @Override
+    public TDeviceSet selectTDeviceSetById(Integer id)
+    {
+        return tDeviceSetMapper.selectTDeviceSetById(id);
+    }
+
+
+    /**
+     * 查询设备设置
+     *
+     * @param deviceIdCode 设备号
+     * @return 设备设置
+     */
+    @Override
+    public TDeviceSet selectTDeviceSetByCode(String deviceIdCode) {
+        return tDeviceSetMapper.selectTDeviceSetByCode(deviceIdCode);
+    }
+
+    /**
+     * 查询设备设置列表
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 设备设置
+     */
+    @Override
+    public List<TDeviceSet> selectTDeviceSetList(TDeviceSet tDeviceSet)
+    {
+        return tDeviceSetMapper.selectTDeviceSetList(tDeviceSet);
+    }
+
+    /**
+     * 新增设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    @Override
+    public int insertTDeviceSet(TDeviceSet tDeviceSet)
+    {
+        if (StringUtils.isNull(this.selectTDeviceSetByCode(tDeviceSet.getDeviceIdCode()))){
+            return tDeviceSetMapper.insertTDeviceSet(tDeviceSet);
+        }else{
+            return this.updateTDeviceSet(tDeviceSet);
+        }
+    }
+
+    /**
+     * 修改设备设置
+     * 
+     * @param tDeviceSet 设备设置
+     * @return 结果
+     */
+    @Override
+    public int updateTDeviceSet(TDeviceSet tDeviceSet)
+    {
+        return tDeviceSetMapper.updateTDeviceSet(tDeviceSet);
+    }
+
+    /**
+     * 批量删除设备设置
+     * 
+     * @param ids 需要删除的设备设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTDeviceSetByIds(Integer[] ids)
+    {
+        return tDeviceSetMapper.deleteTDeviceSetByIds(ids);
+    }
+
+    /**
+     * 删除设备设置信息
+     * 
+     * @param id 设备设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTDeviceSetById(Integer id)
+    {
+        return tDeviceSetMapper.deleteTDeviceSetById(id);
+    }
+}

+ 160 - 0
ruoyi-system/src/main/resources/mapper/system/TDeviceSetMapper.xml

@@ -0,0 +1,160 @@
+<?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.ruoyi.system.mapper.TDeviceSetMapper">
+    
+    <resultMap type="TDeviceSet" id="TDeviceSetResult">
+        <result property="id"    column="id"    />
+        <result property="deviceIdCode"    column="device_id_code"    />
+        <result property="sostelno1"    column="sostelno1"    />
+        <result property="sostelno2"    column="sostelno2"    />
+        <result property="gpsInterval"    column="gps_interval"    />
+        <result property="heartInterval"    column="heart_interval"    />
+        <result property="bodyInterval"    column="body_interval"    />
+        <result property="bloodInterval"    column="blood_interval"    />
+        <result property="oxygenInterval"    column="oxygen_interval"    />
+        <result property="stepStatus"    column="step_status"    />
+        <result property="contactPer1"    column="contact_per1"    />
+        <result property="contactTel1"    column="contact_tel1"    />
+        <result property="contactPer2"    column="contact_per2"    />
+        <result property="contactTel2"    column="contact_tel2"    />
+        <result property="contactPer3"    column="contact_per3"    />
+        <result property="contactTel3"    column="contact_tel3"    />
+        <result property="timeStatus"    column="time_status"    />
+        <result property="timeBegin"    column="time_begin"    />
+        <result property="timeEnd"    column="time_end"    />
+        <result property="useStatus"    column="use_status"    />
+        <result property="fallStatus"    column="fall_status"    />
+        <result property="levelStatus"    column="level_status"    />
+    </resultMap>
+
+    <sql id="selectTDeviceSetVo">
+        select id, device_id_code, sostelno1, sostelno2, gps_interval, heart_interval, body_interval, blood_interval, oxygen_interval, step_status, contact_per1, contact_tel1, contact_per2, contact_tel2, contact_per3, contact_tel3, time_status, time_begin, time_end, use_status, fall_status, level_status from t_device_set
+    </sql>
+
+    <select id="selectTDeviceSetList" parameterType="TDeviceSet" resultMap="TDeviceSetResult">
+        <include refid="selectTDeviceSetVo"/>
+        <where>  
+            <if test="deviceIdCode != null  and deviceIdCode != ''"> and device_id_code = #{deviceIdCode}</if>
+            <if test="sostelno1 != null  and sostelno1 != ''"> and sostelno1 = #{sostelno1}</if>
+            <if test="sostelno2 != null  and sostelno2 != ''"> and sostelno2 = #{sostelno2}</if>
+            <if test="gpsInterval != null  and gpsInterval != ''"> and gps_interval = #{gpsInterval}</if>
+            <if test="heartInterval != null  and heartInterval != ''"> and heart_interval = #{heartInterval}</if>
+            <if test="bodyInterval != null  and bodyInterval != ''"> and body_interval = #{bodyInterval}</if>
+            <if test="bloodInterval != null  and bloodInterval != ''"> and blood_interval = #{bloodInterval}</if>
+            <if test="oxygenInterval != null  and oxygenInterval != ''"> and oxygen_interval = #{oxygenInterval}</if>
+            <if test="stepStatus != null "> and step_status = #{stepStatus}</if>
+            <if test="contactPer1 != null  and contactPer1 != ''"> and contact_per1 = #{contactPer1}</if>
+            <if test="contactTel1 != null  and contactTel1 != ''"> and contact_tel1 = #{contactTel1}</if>
+            <if test="contactPer2 != null  and contactPer2 != ''"> and contact_per2 = #{contactPer2}</if>
+            <if test="contactTel2 != null  and contactTel2 != ''"> and contact_tel2 = #{contactTel2}</if>
+            <if test="contactPer3 != null  and contactPer3 != ''"> and contact_per3 = #{contactPer3}</if>
+            <if test="contactTel3 != null  and contactTel3 != ''"> and contact_tel3 = #{contactTel3}</if>
+            <if test="timeStatus != null "> and time_status = #{timeStatus}</if>
+            <if test="timeBegin != null  and timeBegin != ''"> and time_begin = #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and time_end = #{timeEnd}</if>
+            <if test="useStatus != null "> and use_status = #{useStatus}</if>
+            <if test="fallStatus != null "> and fall_status = #{fallStatus}</if>
+            <if test="levelStatus != null "> and level_status = #{levelStatus}</if>
+        </where>
+    </select>
+    
+    <select id="selectTDeviceSetById" parameterType="Integer" resultMap="TDeviceSetResult">
+        <include refid="selectTDeviceSetVo"/>
+        where id = #{id}
+    </select>
+    <select id="selectTDeviceSetByCode" resultMap="TDeviceSetResult">
+        <include refid="selectTDeviceSetVo"/>
+        where device_id_code = #{device_id_code}
+    </select>
+
+    <insert id="insertTDeviceSet" parameterType="TDeviceSet" useGeneratedKeys="true" keyProperty="id">
+        insert into t_device_set
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceIdCode != null">device_id_code,</if>
+            <if test="sostelno1 != null">sostelno1,</if>
+            <if test="sostelno2 != null">sostelno2,</if>
+            <if test="gpsInterval != null">gps_interval,</if>
+            <if test="heartInterval != null">heart_interval,</if>
+            <if test="bodyInterval != null">body_interval,</if>
+            <if test="bloodInterval != null">blood_interval,</if>
+            <if test="oxygenInterval != null">oxygen_interval,</if>
+            <if test="stepStatus != null">step_status,</if>
+            <if test="contactPer1 != null">contact_per1,</if>
+            <if test="contactTel1 != null">contact_tel1,</if>
+            <if test="contactPer2 != null">contact_per2,</if>
+            <if test="contactTel2 != null">contact_tel2,</if>
+            <if test="contactPer3 != null">contact_per3,</if>
+            <if test="contactTel3 != null">contact_tel3,</if>
+            <if test="timeStatus != null">time_status,</if>
+            <if test="timeBegin != null">time_begin,</if>
+            <if test="timeEnd != null">time_end,</if>
+            <if test="useStatus != null">use_status,</if>
+            <if test="fallStatus != null">fall_status,</if>
+            <if test="levelStatus != null">level_status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceIdCode != null">#{deviceIdCode},</if>
+            <if test="sostelno1 != null">#{sostelno1},</if>
+            <if test="sostelno2 != null">#{sostelno2},</if>
+            <if test="gpsInterval != null">#{gpsInterval},</if>
+            <if test="heartInterval != null">#{heartInterval},</if>
+            <if test="bodyInterval != null">#{bodyInterval},</if>
+            <if test="bloodInterval != null">#{bloodInterval},</if>
+            <if test="oxygenInterval != null">#{oxygenInterval},</if>
+            <if test="stepStatus != null">#{stepStatus},</if>
+            <if test="contactPer1 != null">#{contactPer1},</if>
+            <if test="contactTel1 != null">#{contactTel1},</if>
+            <if test="contactPer2 != null">#{contactPer2},</if>
+            <if test="contactTel2 != null">#{contactTel2},</if>
+            <if test="contactPer3 != null">#{contactPer3},</if>
+            <if test="contactTel3 != null">#{contactTel3},</if>
+            <if test="timeStatus != null">#{timeStatus},</if>
+            <if test="timeBegin != null">#{timeBegin},</if>
+            <if test="timeEnd != null">#{timeEnd},</if>
+            <if test="useStatus != null">#{useStatus},</if>
+            <if test="fallStatus != null">#{fallStatus},</if>
+            <if test="levelStatus != null">#{levelStatus},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTDeviceSet" parameterType="TDeviceSet">
+        update t_device_set
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deviceIdCode != null">device_id_code = #{deviceIdCode},</if>
+            <if test="sostelno1 != null">sostelno1 = #{sostelno1},</if>
+            <if test="sostelno2 != null">sostelno2 = #{sostelno2},</if>
+            <if test="gpsInterval != null">gps_interval = #{gpsInterval},</if>
+            <if test="heartInterval != null">heart_interval = #{heartInterval},</if>
+            <if test="bodyInterval != null">body_interval = #{bodyInterval},</if>
+            <if test="bloodInterval != null">blood_interval = #{bloodInterval},</if>
+            <if test="oxygenInterval != null">oxygen_interval = #{oxygenInterval},</if>
+            <if test="stepStatus != null">step_status = #{stepStatus},</if>
+            <if test="contactPer1 != null">contact_per1 = #{contactPer1},</if>
+            <if test="contactTel1 != null">contact_tel1 = #{contactTel1},</if>
+            <if test="contactPer2 != null">contact_per2 = #{contactPer2},</if>
+            <if test="contactTel2 != null">contact_tel2 = #{contactTel2},</if>
+            <if test="contactPer3 != null">contact_per3 = #{contactPer3},</if>
+            <if test="contactTel3 != null">contact_tel3 = #{contactTel3},</if>
+            <if test="timeStatus != null">time_status = #{timeStatus},</if>
+            <if test="timeBegin != null">time_begin = #{timeBegin},</if>
+            <if test="timeEnd != null">time_end = #{timeEnd},</if>
+            <if test="useStatus != null">use_status = #{useStatus},</if>
+            <if test="fallStatus != null">fall_status = #{fallStatus},</if>
+            <if test="levelStatus != null">level_status = #{levelStatus},</if>
+        </trim>
+        where device_id_code = #{deviceIdCode}
+    </update>
+
+    <delete id="deleteTDeviceSetById" parameterType="Integer">
+        delete from t_device_set where id = #{id}
+    </delete>
+
+    <delete id="deleteTDeviceSetByIds" parameterType="String">
+        delete from t_device_set where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>