mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 12:29:36 +08:00
历史数据查询
This commit is contained in:
parent
f0fe20023e
commit
f533fb6455
@ -0,0 +1,59 @@
|
||||
package com.ics.admin.controller;
|
||||
|
||||
import com.ics.admin.domain.RepairHis;
|
||||
import com.ics.admin.service.IRepairHisService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
import com.ics.common.core.domain.R;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* created at 2024-9-3 23:14
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/repair/his")
|
||||
public class RepairHisController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRepairHisService repairHisService;
|
||||
|
||||
/**
|
||||
* 查询VIEW列表
|
||||
*/
|
||||
@RequiresPermissions(value = {"repair:manage:operator"})
|
||||
@RequestMapping("list")
|
||||
public R list(RepairHis repairHis) {
|
||||
//时间范围处理
|
||||
String beginTime = repairHis.getBeginTime(), endTime = repairHis.getEndTime();
|
||||
if (beginTime != null && endTime != null && beginTime.length() == 10 && endTime.length() == 10) {
|
||||
try {
|
||||
Date s = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, beginTime + " 00:00:00");
|
||||
Date e = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endTime + " 23:59:59");
|
||||
if (s.getTime() <= e.getTime()) {
|
||||
repairHis.getParams().put("beginTime", s);
|
||||
repairHis.getParams().put("endTime", e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//时间格式处理失败则放弃时间搜索条件
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
return result(repairHisService.getRepairHisList(repairHis));
|
||||
}
|
||||
|
||||
@RequiresPermissions("repair:manage:operator")
|
||||
@RequestMapping("get")
|
||||
public R get(Long bxid) {
|
||||
return R.ok().put("data", repairHisService.selectRepairHisById(bxid));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Transient;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* VIEW对象 ics_repair_his
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-09-03
|
||||
*/
|
||||
@Data
|
||||
@TableName("ics_repair_his")
|
||||
public class RepairHis implements Serializable {
|
||||
private static final long serialVersionUID = -202409040025L;
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private Long bxid;
|
||||
|
||||
/**
|
||||
* 报修人id
|
||||
*/
|
||||
private Long uid;
|
||||
|
||||
/**
|
||||
* 报修人姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 报修人电话
|
||||
*/
|
||||
private String tel;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String bxorder;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String headimgurl;
|
||||
|
||||
/**
|
||||
* 微信 openid
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 保修时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date bxsj;
|
||||
|
||||
/**
|
||||
* 接单时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date jdsj;
|
||||
|
||||
/**
|
||||
* 设备类型id
|
||||
*/
|
||||
private Integer gzid;
|
||||
|
||||
/**
|
||||
* 设备类型名称
|
||||
*/
|
||||
private String gztype;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Integer gzzid;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String gzname;
|
||||
|
||||
/**
|
||||
* 地点id
|
||||
*/
|
||||
private Integer ddid;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
private String addr;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
private Integer ddzid;
|
||||
|
||||
/**
|
||||
* 楼层名称
|
||||
*/
|
||||
private String floor;
|
||||
|
||||
/**
|
||||
* 房间号
|
||||
*/
|
||||
private String fjh;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String pic;
|
||||
|
||||
/**
|
||||
* 缩略图
|
||||
*/
|
||||
private String thumb;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 维修人id
|
||||
*/
|
||||
private String wxry;
|
||||
|
||||
/**
|
||||
* 维修人姓名
|
||||
*/
|
||||
private String wxrname;
|
||||
|
||||
/**
|
||||
* 维修人电话
|
||||
*/
|
||||
private String wxrtel;
|
||||
|
||||
/**
|
||||
* 处置结果
|
||||
*/
|
||||
private String bz;
|
||||
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
private Integer pf;
|
||||
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
private String pj;
|
||||
|
||||
/**
|
||||
* 维修人反馈图片
|
||||
*/
|
||||
private String wxpic;
|
||||
|
||||
/**
|
||||
* 不明确含义
|
||||
*/
|
||||
private String bhbz;
|
||||
|
||||
/**
|
||||
* 状态,不明确含义
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private List<RepairHisLog> logs;
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params;
|
||||
|
||||
public Map<String, Object> getParams() {
|
||||
if (params == null) {
|
||||
params = Maps.newHashMap();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.ics.admin.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* created at 2024-9-3 23:19
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class RepairHisLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -202409032319L;
|
||||
|
||||
/** 日志id */
|
||||
private Long czid;
|
||||
|
||||
/** 工单id */
|
||||
private Long bxid;
|
||||
|
||||
/** 处置人姓名 */
|
||||
private String czry;
|
||||
|
||||
/** 处置人时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date czsj;
|
||||
|
||||
/** 处置结果 */
|
||||
private String bz;
|
||||
|
||||
/** 状态,含义不明 */
|
||||
private Integer status;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.RepairHisLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* VIEWMapper接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-09-03
|
||||
*/
|
||||
@Mapper
|
||||
public interface RepairHisLogMapper {
|
||||
|
||||
/**
|
||||
* 查询日志列表
|
||||
*/
|
||||
List<RepairHisLog> getRepairHisLogList(Long bxid);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ics.admin.mapper;
|
||||
|
||||
import com.ics.admin.domain.RepairHis;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RepairHisMapper {
|
||||
/**
|
||||
* 查询VIEW列表
|
||||
*
|
||||
* @param repairHis VIEW
|
||||
* @return VIEW集合
|
||||
*/
|
||||
List<RepairHis> getRepairHisList(RepairHis repairHis);
|
||||
/**
|
||||
* 查询VIEW
|
||||
*
|
||||
* @param bxid VIEWID
|
||||
* @return VIEW
|
||||
*/
|
||||
RepairHis selectRepairHisById(Long bxid);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.RepairHis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* VIEWService接口
|
||||
*
|
||||
* @author ics
|
||||
* @date 2024-09-03
|
||||
*/
|
||||
public interface IRepairHisService {
|
||||
/**
|
||||
* 查询VIEW列表
|
||||
*
|
||||
* @param repairHis VIEW
|
||||
* @return VIEW集合
|
||||
*/
|
||||
List<RepairHis> getRepairHisList(RepairHis repairHis);
|
||||
|
||||
/**
|
||||
* 查询VIEW
|
||||
*
|
||||
* @param bxid VIEWID
|
||||
* @return VIEW
|
||||
*/
|
||||
RepairHis selectRepairHisById(Long bxid);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.ics.admin.service;
|
||||
|
||||
import com.ics.admin.domain.RepairHis;
|
||||
import com.ics.admin.domain.RepairHisLog;
|
||||
import com.ics.admin.mapper.RepairHisLogMapper;
|
||||
import com.ics.admin.mapper.RepairHisMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created at 2024-9-3 23:12
|
||||
*
|
||||
* @author lujiang
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class RepairHisServiceImpl implements IRepairHisService {
|
||||
|
||||
@Autowired
|
||||
private RepairHisMapper repairHisMapper;
|
||||
|
||||
@Autowired
|
||||
private RepairHisLogMapper repairHisLogMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<RepairHis> getRepairHisList(RepairHis repairHis) {
|
||||
return repairHisMapper.getRepairHisList(repairHis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepairHis selectRepairHisById(Long bxid) {
|
||||
RepairHis repairHis = repairHisMapper.selectRepairHisById(bxid);
|
||||
if (repairHis == null) return null;
|
||||
List<RepairHisLog> list = repairHisLogMapper.getRepairHisLogList(bxid);
|
||||
repairHis.setLogs(list);
|
||||
return repairHis;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?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.ics.admin.mapper.RepairHisLogMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.RepairHisLog" id="RepairHisLogResult">
|
||||
<result property="czid" column="czid" />
|
||||
<result property="bxid" column="bxid" />
|
||||
<result property="czry" column="czry" />
|
||||
<result property="czsj" column="czsj" />
|
||||
<result property="bz" column="bz" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRepairHisLogVo">
|
||||
SELECT czid, bxid, czry, czsj, bz, status
|
||||
FROM ics_repair_his_log
|
||||
</sql>
|
||||
|
||||
<select id="getRepairHisLogList" parameterType="Long" resultMap="RepairHisLogResult">
|
||||
<include refid="selectRepairHisLogVo"/>
|
||||
where bxid=#{bxid} order by czid
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,68 @@
|
||||
<?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.ics.admin.mapper.RepairHisMapper">
|
||||
|
||||
<resultMap type="com.ics.admin.domain.RepairHis" id="RepairHisResult">
|
||||
<result property="bxid" column="bxid" />
|
||||
<result property="uid" column="uid" />
|
||||
<result property="name" column="name" />
|
||||
<result property="tel" column="tel" />
|
||||
<result property="bxorder" column="bxorder" />
|
||||
<result property="nickname" column="nickname" />
|
||||
<result property="headimgurl" column="headimgurl" />
|
||||
<result property="openid" column="openid" />
|
||||
<result property="bxsj" column="bxsj" />
|
||||
<result property="jdsj" column="jdsj" />
|
||||
<result property="gzid" column="gzid" />
|
||||
<result property="gztype" column="gztype" />
|
||||
<result property="gzzid" column="gzzid" />
|
||||
<result property="gzname" column="gzname" />
|
||||
<result property="ddid" column="ddid" />
|
||||
<result property="addr" column="addr" />
|
||||
<result property="ddzid" column="ddzid" />
|
||||
<result property="floor" column="floor" />
|
||||
<result property="fjh" column="fjh" />
|
||||
<result property="pic" column="pic" />
|
||||
<result property="thumb" column="thumb" />
|
||||
<result property="desc" column="desc" />
|
||||
<result property="wxry" column="wxry" />
|
||||
<result property="wxrname" column="wxrname" />
|
||||
<result property="wxrtel" column="wxrtel" />
|
||||
<result property="bz" column="bz" />
|
||||
<result property="pf" column="pf" />
|
||||
<result property="pj" column="pj" />
|
||||
<result property="wxpic" column="wxpic" />
|
||||
<result property="bhbz" column="bhbz" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRepairHisVo">
|
||||
SELECT bxid, uid, name, tel, bxorder, nickname, headimgurl, openid, bxsj, jdsj, gzid, gztype, gzzid, gzname, ddid, addr, ddzid, floor, fjh, pic, thumb, `desc`, wxry, wxrname, wxrtel, bz, pf, pj, wxpic, bhbz, status FROM ics_repair_his
|
||||
</sql>
|
||||
|
||||
<select id="getRepairHisList" parameterType="RepairHis" resultMap="RepairHisResult">
|
||||
<include refid="selectRepairHisVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
|
||||
<if test="tel != null and tel != ''"> AND tel LIKE CONCAT('%', #{tel}, '%')</if>
|
||||
<if test="bxorder != null and bxorder != ''"> AND bxorder LIKE CONCAT('%', #{bxorder}, '%')</if>
|
||||
<if test="addr != null and addr != ''"> AND addr LIKE CONCAT('%', #{addr}, '%')</if>
|
||||
<if test="floor != null and floor != ''"> AND floor LIKE CONCAT('%', #{floor}, '%')</if>
|
||||
<if test="fjh != null and fjh != ''"> AND fjh LIKE CONCAT('%', #{fjh}, '%')</if>
|
||||
<if test="wxrname != null and wxrname != ''"> AND wxrname LIKE CONCAT('%', #{wxrname}, '%')</if>
|
||||
<if test="wxrtel != null and wxrtel != ''"> AND wxrtel LIKE CONCAT('%', #{wxrtel}, '%')</if>
|
||||
<if test="desc != null and desc != ''"> AND `desc` LIKE CONCAT('%', #{desc}, '%')</if>
|
||||
<if test="params.beginTime != null and params.endTime != null"> and bxsj between #{params.beginTime} and #{params.endTime}</if>
|
||||
order by bxid
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRepairHisById" parameterType="Long" resultMap="RepairHisResult">
|
||||
<include refid="selectRepairHisVo"/>
|
||||
WHERE bxid = #{bxid}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user