whyczh
2022-05-27 b44f5d16d7a14bb88545695b48d5d16c673763c2
查询事件总览列表接口更新
2个文件已修改
43 ■■■■ 已修改文件
src/main/java/com/whyc/pojo/BtsStateChangeInf.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BtsStateChangeInfMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/BtsStateChangeInf.java
@@ -1,6 +1,8 @@
package com.whyc.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@@ -10,6 +12,7 @@
@ApiModel(value = "btsStateChangeInf",description = "事件信息")
@TableName(schema = "db_batt_history",value = "tb_btsstaechange_inf")
public class BtsStateChangeInf {
    @TableId(type = IdType.AUTO)
    private Integer num;
    private Integer devId;
    private Date recordTime;
@@ -21,4 +24,15 @@
    private String note;
    @TableField(exist = false)
    private String stationName;
    @TableField(exist = false)
    private String province;
    @TableField(exist = false)
    private String city;
    @TableField(exist = false)
    private String county;
}
src/main/resources/mapper/BtsStateChangeInfMapper.xml
@@ -4,24 +4,33 @@
    <select id="searchByCondition" resultType="com.whyc.pojo.BtsStateChangeInf">
        select distinct(db_batt_history.tb_btsstaechange_inf.num),dev_id,db_batt_history.tb_btsstaechange_inf.record_time,last_state,now_state,event_type,note
        ,db_battinf.tb_battinf.stationName
        select distinct(inf.num),dev_id,record_time,last_state,now_state,event_type,note
        ,b.stationName
        from
        db_batt_history.tb_btsstaechange_inf,
        db_battinf.tb_battinf
        db_batt_history.tb_btsstaechange_inf inf,
        db_battinf.tb_battinf b
        <where>
            db_batt_history.tb_btsstaechange_inf.dev_id=db_battinf.tb_battinf.FBSDeviceId
            inf.dev_id=b.FBSDeviceId
            <if test="binf.devId!=null and binf.devId!=0">
                and dev_id=#{binf.devId}
                and inf.dev_id=#{binf.devId}
            </if>
            <if test="binf.province!=null and binf.province!='' and binf.province!='null'">
                and b.stationName1=#{binf.province}
            </if>
            <if test="binf.city!=null and binf.city!='' and binf.city!='null'">
                and b.stationName2=#{binf.city}
            </if>
            <if test="binf.county!=null and binf.county!='' and binf.county!='null'">
                and b.stationName5=#{binf.county}
            </if>
            <if test="binf.recordTime!=null and binf.recordTime1!=null">
                and db_batt_history.tb_btsstaechange_inf.record_time>=#{binf.recordTime}
                and db_batt_history.tb_btsstaechange_inf.record_time&lt;=#{binf.recordTime1}
                and inf.record_time>=#{binf.recordTime}
                and inf.record_time&lt;=#{binf.recordTime1}
            </if>
            <if test="binf.eventType!=0">
                and event_type=#{binf.eventType}
                and inf.event_type=#{binf.eventType}
            </if>
        </where>
        order by  db_batt_history.tb_btsstaechange_inf.record_time asc
        order by inf.record_time desc
    </select>
</mapper>