10.31设备档案查询修改,设备类型创建日期修改

dev
xiaohuo 8 months ago
parent a26e383f74
commit 2a9ac317a4
  1. 4
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquManu.java
  2. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquSupplier.java
  3. 5
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquType.java
  4. 2
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquTypeServiceImpl.java
  5. 48
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml
  6. 3
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquTypeMapper.xml

@ -41,8 +41,8 @@ public class EquManu
/** 添加日期 */
//@JsonIgnore
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 状态(0-禁用,1-启用) */

@ -53,7 +53,8 @@ public class EquSupplier
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;

@ -38,10 +38,11 @@ public class EquType
/** 添加日期 */
//@JsonIgnore
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
//@JsonIgnore
private String createBy;

@ -1,5 +1,6 @@
package com.alops.system.service.impl;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -71,6 +72,7 @@ public class EquTypeServiceImpl implements IEquTypeService
public int updateEquType(EquType equType)
{
String userName = SecurityUtils.getLoginUser().getUser().getUserName();
equType.setCreateDate(new Date());
equType.setCreateBy(userName);
return equTypeMapper.updateEquType(equType);
}

@ -164,6 +164,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.floor AS floor
</sql>
<!-- <select id="selectEquBaseList" parameterType="equBaseQueryDto" resultType="com.alops.system.domain.vo.queryEquBaseVO">-->
<!-- SELECT-->
<!-- <include refid="selectEquBaseVo2"/>-->
<!-- FROM equ_base b-->
<!-- LEFT JOIN equ_manu m ON b.manufacture = m.id-->
<!-- LEFT JOIN equ_supplier s ON b.supplier_id = s.id-->
<!-- LEFT JOIN equ_type t ON b.equ_type = t.id-->
<!-- LEFT JOIN sys_user su ON b.create_by = su.user_id-->
<!-- LEFT JOIN (-->
<!-- &#45;&#45; 子查询:每台设备取最新的健康度-->
<!-- SELECT eg.equ_id, eg.health-->
<!-- FROM equ_gather eg-->
<!-- INNER JOIN (-->
<!-- SELECT equ_id, MAX(gather_time) AS max_time-->
<!-- FROM equ_gather-->
<!-- GROUP BY equ_id-->
<!-- ) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time-->
<!-- ) g ON b.id = g.equ_id-->
<!-- <where>-->
<!-- <if test="minTime != null">-->
<!-- AND b.create_date &gt;= #{minTime}-->
<!-- </if>-->
<!-- <if test="maxTime != null">-->
<!-- AND b.create_date &lt;= #{maxTime}-->
<!-- </if>-->
<!-- </where>-->
<!-- ORDER BY b.create_date DESC-->
<!-- </select>-->
<select id="selectEquBaseList" parameterType="equBaseQueryDto" resultType="com.alops.system.domain.vo.queryEquBaseVO">
SELECT
<include refid="selectEquBaseVo2"/>
@ -182,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY equ_id
) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time
) g ON b.id = g.equ_id
<where>
<if test="minTime != null">
AND b.create_date &gt;= #{minTime}
@ -189,10 +219,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maxTime != null">
AND b.create_date &lt;= #{maxTime}
</if>
<!-- 模糊查询:设备名称 -->
<if test="name != null and name != ''">
AND b.name LIKE CONCAT('%', #{name}, '%')
</if>
<!-- 模糊查询:安装位置 -->
<if test="location != null and location != ''">
AND b.location LIKE CONCAT('%', #{location}, '%')
</if>
<!-- 精确查询:状态 -->
<if test="status != null and status != ''">
AND b.status = #{status}
</if>
</where>
ORDER BY b.create_date DESC
</select>
<select id="selectEquMonitorListPaged" resultType="MonitorListDto">
SELECT
c.id,
@ -508,6 +555,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equImage != null">equ_image = #{equImage},</if>
<if test="equNumber != null">equ_number = #{equNumber},</if>
<if test="floor != null">floor = #{floor},</if>
create_date = create_date
</trim>
where id = #{id}
</update>

@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="description != null">description,</if>
<if test="image != null">image,</if>
<if test="createBy != null">create_by,</if>
<if test="createDate != null">create_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="description != null">#{description},</if>
<if test="image != null">#{image},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
</trim>
</insert>

Loading…
Cancel
Save