459242451@qq.com 3 жил өмнө
parent
commit
5919185a4b

+ 98 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlPlanRecordController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.web.controller.qdtl;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.qdtl.domain.TlPlanRecord;
+import com.ruoyi.qdtl.service.ITlPlanRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 巡检计划记录Controller
+ *
+ * @author ruoyi
+ * @date 2022-03-30
+ */
+@RestController
+@RequestMapping("/qdtl/record")
+public class TlPlanRecordController extends BaseController {
+    @Autowired
+    private ITlPlanRecordService tlPlanRecordService;
+
+    /**
+     * 查询巡检计划记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlPlanRecord tlPlanRecord) {
+        startPage();
+        List<TlPlanRecord> list = tlPlanRecordService.selectTlPlanRecordList(tlPlanRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检计划记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:export')")
+    @Log(title = "巡检计划记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TlPlanRecord tlPlanRecord) {
+        List<TlPlanRecord> list = tlPlanRecordService.selectTlPlanRecordList(tlPlanRecord);
+        ExcelUtil<TlPlanRecord> util = new ExcelUtil<TlPlanRecord>(TlPlanRecord.class);
+        util.exportExcel(response, list, "巡检计划记录数据");
+    }
+
+    /**
+     * 获取巡检计划记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tlPlanRecordService.selectTlPlanRecordById(id));
+    }
+
+    /**
+     * 新增巡检计划记录
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:add')")
+    @Log(title = "巡检计划记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlPlanRecord tlPlanRecord) {
+        return toAjax(tlPlanRecordService.insertTlPlanRecord(tlPlanRecord));
+    }
+
+    /**
+     * 修改巡检计划记录
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:edit')")
+    @Log(title = "巡检计划记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlPlanRecord tlPlanRecord) {
+        return toAjax(tlPlanRecordService.updateTlPlanRecord(tlPlanRecord));
+    }
+
+    /**
+     * 删除巡检计划记录
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:record:remove')")
+    @Log(title = "巡检计划记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tlPlanRecordService.deleteTlPlanRecordByIds(ids));
+    }
+}

+ 178 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlPlanRecord.java

@@ -0,0 +1,178 @@
+package com.ruoyi.qdtl.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;
+
+/**
+ * 巡检计划记录对象 tl_plan_record
+ * 
+ * @author ruoyi
+ * @date 2022-03-30
+ */
+public class TlPlanRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 计划id */
+    @Excel(name = "计划id")
+    private Long planId;
+
+    /** 计划日期 */
+    @Excel(name = "计划日期")
+    private String planDate;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String planName;
+
+    /** 人员id */
+    @Excel(name = "人员id")
+    private Long userId;
+
+    /** 人员姓名 */
+    @Excel(name = "人员姓名")
+    private String nickName;
+
+    /** 设备卡号 */
+    @Excel(name = "设备卡号")
+    private String card;
+
+    /** 巡检点卡号 */
+    @Excel(name = "巡检点卡号")
+    private String checkpointCard;
+
+    /** 巡检器卡号 */
+    @Excel(name = "巡检器卡号")
+    private String deviceCode;
+
+    /** 经纬度 */
+    @Excel(name = "经纬度")
+    private String fence;
+
+    /** 计划分数 */
+    @Excel(name = "计划分数")
+    private String score;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPlanId(Long planId) 
+    {
+        this.planId = planId;
+    }
+
+    public Long getPlanId() 
+    {
+        return planId;
+    }
+    public void setPlanDate(String planDate) 
+    {
+        this.planDate = planDate;
+    }
+
+    public String getPlanDate() 
+    {
+        return planDate;
+    }
+    public void setPlanName(String planName) 
+    {
+        this.planName = planName;
+    }
+
+    public String getPlanName() 
+    {
+        return planName;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setNickName(String nickName) 
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName() 
+    {
+        return nickName;
+    }
+    public void setCard(String card) 
+    {
+        this.card = card;
+    }
+
+    public String getCard() 
+    {
+        return card;
+    }
+    public void setCheckpointCard(String checkpointCard) 
+    {
+        this.checkpointCard = checkpointCard;
+    }
+
+    public String getCheckpointCard() 
+    {
+        return checkpointCard;
+    }
+    public void setDeviceCode(String deviceCode) 
+    {
+        this.deviceCode = deviceCode;
+    }
+
+    public String getDeviceCode() 
+    {
+        return deviceCode;
+    }
+    public void setFence(String fence) 
+    {
+        this.fence = fence;
+    }
+
+    public String getFence() 
+    {
+        return fence;
+    }
+    public void setScore(String score) 
+    {
+        this.score = score;
+    }
+
+    public String getScore() 
+    {
+        return score;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("planId", getPlanId())
+            .append("planDate", getPlanDate())
+            .append("planName", getPlanName())
+            .append("userId", getUserId())
+            .append("nickName", getNickName())
+            .append("card", getCard())
+            .append("checkpointCard", getCheckpointCard())
+            .append("deviceCode", getDeviceCode())
+            .append("fence", getFence())
+            .append("createTime", getCreateTime())
+            .append("score", getScore())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlPlanRecordMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlPlanRecord;
+
+/**
+ * 巡检计划记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-30
+ */
+public interface TlPlanRecordMapper 
+{
+    /**
+     * 查询巡检计划记录
+     * 
+     * @param id 巡检计划记录主键
+     * @return 巡检计划记录
+     */
+    public TlPlanRecord selectTlPlanRecordById(Long id);
+
+    /**
+     * 查询巡检计划记录列表
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 巡检计划记录集合
+     */
+    public List<TlPlanRecord> selectTlPlanRecordList(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 新增巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    public int insertTlPlanRecord(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 修改巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    public int updateTlPlanRecord(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 删除巡检计划记录
+     * 
+     * @param id 巡检计划记录主键
+     * @return 结果
+     */
+    public int deleteTlPlanRecordById(Long id);
+
+    /**
+     * 批量删除巡检计划记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlPlanRecordByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlPlanRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlPlanRecord;
+
+/**
+ * 巡检计划记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-30
+ */
+public interface ITlPlanRecordService 
+{
+    /**
+     * 查询巡检计划记录
+     * 
+     * @param id 巡检计划记录主键
+     * @return 巡检计划记录
+     */
+    public TlPlanRecord selectTlPlanRecordById(Long id);
+
+    /**
+     * 查询巡检计划记录列表
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 巡检计划记录集合
+     */
+    public List<TlPlanRecord> selectTlPlanRecordList(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 新增巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    public int insertTlPlanRecord(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 修改巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    public int updateTlPlanRecord(TlPlanRecord tlPlanRecord);
+
+    /**
+     * 批量删除巡检计划记录
+     * 
+     * @param ids 需要删除的巡检计划记录主键集合
+     * @return 结果
+     */
+    public int deleteTlPlanRecordByIds(Long[] ids);
+
+    /**
+     * 删除巡检计划记录信息
+     * 
+     * @param id 巡检计划记录主键
+     * @return 结果
+     */
+    public int deleteTlPlanRecordById(Long id);
+}

+ 95 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlPlanRecordServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlPlanRecordMapper;
+import com.ruoyi.qdtl.domain.TlPlanRecord;
+import com.ruoyi.qdtl.service.ITlPlanRecordService;
+
+/**
+ * 巡检计划记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-03-30
+ */
+@Service
+public class TlPlanRecordServiceImpl implements ITlPlanRecordService 
+{
+    @Autowired
+    private TlPlanRecordMapper tlPlanRecordMapper;
+
+    /**
+     * 查询巡检计划记录
+     * 
+     * @param id 巡检计划记录主键
+     * @return 巡检计划记录
+     */
+    @Override
+    public TlPlanRecord selectTlPlanRecordById(Long id)
+    {
+        return tlPlanRecordMapper.selectTlPlanRecordById(id);
+    }
+
+    /**
+     * 查询巡检计划记录列表
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 巡检计划记录
+     */
+    @Override
+    public List<TlPlanRecord> selectTlPlanRecordList(TlPlanRecord tlPlanRecord)
+    {
+        return tlPlanRecordMapper.selectTlPlanRecordList(tlPlanRecord);
+    }
+
+    /**
+     * 新增巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    @Override
+    public int insertTlPlanRecord(TlPlanRecord tlPlanRecord)
+    {
+        tlPlanRecord.setCreateTime(DateUtils.getNowDate());
+        return tlPlanRecordMapper.insertTlPlanRecord(tlPlanRecord);
+    }
+
+    /**
+     * 修改巡检计划记录
+     * 
+     * @param tlPlanRecord 巡检计划记录
+     * @return 结果
+     */
+    @Override
+    public int updateTlPlanRecord(TlPlanRecord tlPlanRecord)
+    {
+        return tlPlanRecordMapper.updateTlPlanRecord(tlPlanRecord);
+    }
+
+    /**
+     * 批量删除巡检计划记录
+     * 
+     * @param ids 需要删除的巡检计划记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlPlanRecordByIds(Long[] ids)
+    {
+        return tlPlanRecordMapper.deleteTlPlanRecordByIds(ids);
+    }
+
+    /**
+     * 删除巡检计划记录信息
+     * 
+     * @param id 巡检计划记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlPlanRecordById(Long id)
+    {
+        return tlPlanRecordMapper.deleteTlPlanRecordById(id);
+    }
+}

+ 105 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlPlanRecordMapper.xml

@@ -0,0 +1,105 @@
+<?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.qdtl.mapper.TlPlanRecordMapper">
+    
+    <resultMap type="TlPlanRecord" id="TlPlanRecordResult">
+        <result property="id"    column="id"    />
+        <result property="planId"    column="plan_id"    />
+        <result property="planDate"    column="plan_date"    />
+        <result property="planName"    column="plan_name"    />
+        <result property="userId"    column="user_id"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="card"    column="card"    />
+        <result property="checkpointCard"    column="checkpoint_card"    />
+        <result property="deviceCode"    column="device_code"    />
+        <result property="fence"    column="fence"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="score"    column="score"    />
+    </resultMap>
+
+    <sql id="selectTlPlanRecordVo">
+        select id, plan_id, plan_date, plan_name, user_id, nick_name, card, checkpoint_card, device_code, fence, create_time, score from tl_plan_record
+    </sql>
+
+    <select id="selectTlPlanRecordList" parameterType="TlPlanRecord" resultMap="TlPlanRecordResult">
+        <include refid="selectTlPlanRecordVo"/>
+        <where>  
+            <if test="planId != null "> and plan_id = #{planId}</if>
+            <if test="planDate != null  and planDate != ''"> and plan_date = #{planDate}</if>
+            <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="card != null  and card != ''"> and card = #{card}</if>
+            <if test="checkpointCard != null  and checkpointCard != ''"> and checkpoint_card = #{checkpointCard}</if>
+            <if test="deviceCode != null  and deviceCode != ''"> and device_code = #{deviceCode}</if>
+            <if test="fence != null  and fence != ''"> and fence = #{fence}</if>
+            <if test="score != null  and score != ''"> and score = #{score}</if>
+        </where>
+    </select>
+    
+    <select id="selectTlPlanRecordById" parameterType="Long" resultMap="TlPlanRecordResult">
+        <include refid="selectTlPlanRecordVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTlPlanRecord" parameterType="TlPlanRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_plan_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="planId != null">plan_id,</if>
+            <if test="planDate != null">plan_date,</if>
+            <if test="planName != null">plan_name,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="nickName != null">nick_name,</if>
+            <if test="card != null">card,</if>
+            <if test="checkpointCard != null">checkpoint_card,</if>
+            <if test="deviceCode != null">device_code,</if>
+            <if test="fence != null">fence,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="score != null">score,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="planId != null">#{planId},</if>
+            <if test="planDate != null">#{planDate},</if>
+            <if test="planName != null">#{planName},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="nickName != null">#{nickName},</if>
+            <if test="card != null">#{card},</if>
+            <if test="checkpointCard != null">#{checkpointCard},</if>
+            <if test="deviceCode != null">#{deviceCode},</if>
+            <if test="fence != null">#{fence},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="score != null">#{score},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTlPlanRecord" parameterType="TlPlanRecord">
+        update tl_plan_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="planId != null">plan_id = #{planId},</if>
+            <if test="planDate != null">plan_date = #{planDate},</if>
+            <if test="planName != null">plan_name = #{planName},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
+            <if test="card != null">card = #{card},</if>
+            <if test="checkpointCard != null">checkpoint_card = #{checkpointCard},</if>
+            <if test="deviceCode != null">device_code = #{deviceCode},</if>
+            <if test="fence != null">fence = #{fence},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="score != null">score = #{score},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlPlanRecordById" parameterType="Long">
+        delete from tl_plan_record where id = #{id}
+    </delete>
+
+    <delete id="deleteTlPlanRecordByIds" parameterType="String">
+        delete from tl_plan_record where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>