Commit 260b9f72 authored by zhoushiguang's avatar zhoushiguang

研判分析

parent 7d1ef3c4
package net.wanji.opt.api;
import com.alibaba.fastjson.JSON;
/**
* 统一API响应结果封装
*/
public class Result {
private int status;
private String msg;
private Object data;
public Result setCode(ResultCode resultCode) {
this.status = resultCode.status;
return this;
}
public Object getData() {
return data;
}
public Result setData(Object data) {
this.data = data;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
public int getStatus() {
return status;
}
public Result setStatus(int status) {
this.status = status;
return this;
}
public String getMsg() {
return msg;
}
public Result setMsg(String msg) {
this.msg = msg;
return this;
}
}
package net.wanji.opt.api;
/**
* 响应码枚举,参考HTTP状态码的语义
*/
public enum ResultCode {
SUCCESS(200),//成功
FAIL(400),//失败
UNAUTHORIZED(401),//未认证(签名错误)
NOT_FOUND(404),//接口不存在
INTERNAL_SERVER_ERROR(500);//服务器内部错误
public int status;
ResultCode(int status) {
this.status = status;
}
}
package net.wanji.opt.api;
/**
* 响应结果生成工具
*/
public class ResultGenerator {
private static final String DEFAULT_SUCCESS_MESSAGE = "success";
public static Result genSuccessResult() {
return new Result()
.setCode(ResultCode.SUCCESS)
.setMsg(DEFAULT_SUCCESS_MESSAGE);
}
public static Result genSuccessResult(Object data) {
return new Result()
.setCode(ResultCode.SUCCESS)
.setMsg(DEFAULT_SUCCESS_MESSAGE)
.setData(data);
}
public static Result genFailResult(String message) {
return new Result()
.setCode(ResultCode.FAIL)
.setMsg(message);
}
}
package net.wanji.opt.controllerv2.judgeanalysis;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.controllerv2.judgeanalysis.api.response.AreaProblemOverview;
import net.wanji.opt.servicev2.TrendServiceV2;
import net.wanji.opt.vo2.CrossGreenStatusTimeRateVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import java.util.Collections;
import java.util.List;
/**
* <p>
* 绿波问题分析 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-13
*/
@RestController
@RequestMapping("/analysisProblemGreenDay")
public class AnalysisProblemAreaDayController {
@ApiOperation(value = "研判分析-区域问题总览", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/areaProblemOverview")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AreaProblemOverview.class),
})
public JsonViewObject areaProblemOverview() {
return JsonViewObject.newInstance().success(null);
}
}
package net.wanji.opt.controllerv2.judgeanalysis;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemCrossDayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.wanji.opt.api.ResultGenerator;
import javax.validation.Valid;
import java.util.List;
/**
* <p>
* 路口问题分析 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-12
*/
* <p>
* 路口问题分析 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-13
*/
@Api(tags = "路口问题分析")
@RestController
@RequestMapping("/analysisProblemCrossDay")
@RequestMapping("/analysis-problem-cross-day")
public class AnalysisProblemCrossDayController {
}
@Autowired
private AnalysisProblemCrossDayService analysisProblemCrossDayService;
@ApiOperation(value = "路口问题分析详情", response = AnalysisProblemCrossDay.class)
@GetMapping(value = "/info/{id}")
public Object info(@PathVariable Long id) {
Object data = analysisProblemCrossDayService.info(id);
return ResultGenerator.genSuccessResult(data);
}
@ApiOperation(value = "路口问题分析新增")
@PostMapping(value = "/add")
public Object add(@Valid @RequestBody AnalysisProblemCrossDay param) {
analysisProblemCrossDayService.add(param);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "路口问题分析修改")
@PostMapping(value = "/modify")
public Object modify(@Valid @RequestBody AnalysisProblemCrossDay param) {
analysisProblemCrossDayService.modify(param);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "路口问题分析删除(单个条目)")
@GetMapping(value = "/remove/{id}")
public Object remove(@PathVariable Long id) {
analysisProblemCrossDayService.remove(id);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "路口问题分析删除(多个条目)")
@PostMapping(value = "/removes")
public Object removes(@Valid @RequestBody List<Long> ids) {
analysisProblemCrossDayService.removes(ids);
return ResultGenerator.genSuccessResult();
}
}
\ No newline at end of file
package net.wanji.opt.controllerv2.judgeanalysis;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemGreenDayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.wanji.opt.api.ResultGenerator;
import javax.validation.Valid;
import java.util.List;
/**
* <p>
* 绿波问题分析 前端控制器
* </p>
*
* @author fengyi
* @since 2025-03-13
*/
@Api(tags = "绿波问题分析")
@RestController
@RequestMapping("/analysis-problem-green-day")
public class AnalysisProblemGreenDayController {
@Autowired
private AnalysisProblemGreenDayService analysisProblemGreenDayService;
@ApiOperation(value = "绿波问题分析详情", response = AnalysisProblemGreenDay.class)
@GetMapping(value = "/info/{id}")
public Object info(@PathVariable Long id) {
Object data = analysisProblemGreenDayService.info(id);
return ResultGenerator.genSuccessResult(data);
}
@ApiOperation(value = "绿波问题分析新增")
@PostMapping(value = "/add")
public Object add(@Valid @RequestBody AnalysisProblemGreenDay param) {
analysisProblemGreenDayService.add(param);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "绿波问题分析修改")
@PostMapping(value = "/modify")
public Object modify(@Valid @RequestBody AnalysisProblemGreenDay param) {
analysisProblemGreenDayService.modify(param);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "绿波问题分析删除(单个条目)")
@GetMapping(value = "/remove/{id}")
public Object remove(@PathVariable Long id) {
analysisProblemGreenDayService.remove(id);
return ResultGenerator.genSuccessResult();
}
@ApiOperation(value = "绿波问题分析删除(多个条目)")
@PostMapping(value = "/removes")
public Object removes(@Valid @RequestBody List<Long> ids) {
analysisProblemGreenDayService.removes(ids);
return ResultGenerator.genSuccessResult();
}
}
\ No newline at end of file
package net.wanji.opt.controllerv2.judgeanalysis.api.response;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class AreaProblemOverview extends ParentResult {
private List<EventAnalysisResultResponse> content;
public List<EventAnalysisResultResponse> getContent() {
return content;
}
public AreaProblemOverview setContent( List<EventAnalysisResultResponse> content) {
this.content = content;
return this;
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
@Data
class EventAnalysisResultResponse {
@ApiModelProperty(value = "问题类型编码 ",example = "1")
private String eventCode;
@ApiModelProperty(value = "问题类型描述",example = "路口拥堵")
private String eventDesc;
@ApiModelProperty(value = "问题数量",example = "1")
private Integer number;
}
package net.wanji.opt.controllerv2.judgeanalysis.api.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ParentResult {
@ApiModelProperty(value = "响应状态")
private String status;
@ApiModelProperty(value = "响应状态描述",dataType = "String")
private String message;
@ApiModelProperty(value = "响应数据体")
private Object content;
@ApiModelProperty(value = "响应状态码")
private Integer code;
@ApiModelProperty(value = "响应时间戳")
private Long timestamp;
}
package net.wanji.opt.dao.mapper.judgeanalysis;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AnalysisProblemCrossDayMapper extends BaseMapper<AnalysisProblemCrossDay>{
......
package net.wanji.opt.dao.mapper.judgeanalysis;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface AnalysisProblemGreenDayMapper extends BaseMapper<AnalysisProblemGreenDay>{
/**
* 查询表t_analysis_problem_green_day所有信息
*/
List<AnalysisProblemGreenDay> findAllAnalysisProblemGreenDay();
/**
* 根据主键id查询表t_analysis_problem_green_day信息
* @param id
*/
AnalysisProblemGreenDay findAnalysisProblemGreenDayByid(@Param("id") String id);
/**
* 根据条件查询表t_analysis_problem_green_day信息
* @param analysisProblemGreenDay
*/
List<AnalysisProblemGreenDay> findAnalysisProblemGreenDayByCondition(AnalysisProblemGreenDay analysisProblemGreenDay);
/**
* 根据主键id查询表t_analysis_problem_green_day信息
* @param id
*/
Integer deleteAnalysisProblemGreenDayByid(@Param("id") String id);
/**
* 根据主键id更新表t_analysis_problem_green_day信息
* @param analysisProblemGreenDay
*/
Integer updateAnalysisProblemGreenDayByid(AnalysisProblemGreenDay analysisProblemGreenDay);
/**
* 新增表t_analysis_problem_green_day信息
* @param analysisProblemGreenDay
*/
Integer addAnalysisProblemGreenDay(AnalysisProblemGreenDay analysisProblemGreenDay);
}
package net.wanji.opt.entity.judgeanalysis;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* <p>
* 路口问题分析
* </p>
*
* @author fengyi
* @since 2025-03-10
*/
@Getter
@Setter
@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("t_analysis_problem_cross_day")
@ApiModel(value = "AnalysisProblemCrossDay对象", description = "路口问题分析")
public class AnalysisProblemCrossDay implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private String id;
@ApiModelProperty("区域ID")
@TableField("area_id")
/**
* 区域ID
*/
private String areaId;
@ApiModelProperty("事件一级类别 1:机动车事件 2:非机动车事件 3:行人事件 4:路口事件")
@TableField("event_category")
/**
* 事件一级类别 1:机动车事件 2:非机动车事件 3:行人事件 4:路口事件
*/
private String eventCategory;
@ApiModelProperty("二级类别")
@TableField("event_type")
/**
* 二级类别
*/
private String eventType;
@ApiModelProperty("事件发生总数量")
@TableField("event_number")
/**
* 事件发生总数量
*/
private Integer eventNumber;
@ApiModelProperty("事件发生总时长")
@TableField("event_total_time")
/**
* 事件发生总时长
*/
private Integer eventTotalTime;
@ApiModelProperty("统计窗口的开始时间")
@TableField("window_start_time")
/**
* 统计窗口的开始时间
*/
private LocalDateTime windowStartTime;
@ApiModelProperty("统计窗口的结束时间")
@TableField("window_end_time")
/**
* 统计窗口的结束时间
*/
private LocalDateTime windowEndTime;
@ApiModelProperty("路口id")
@TableField("cross_id")
/**
* 路口id
*/
private String crossId;
@ApiModelProperty("格式:yyyy-MM-dd")
@TableField("dt")
/**
* 格式:yyyy-MM-dd
*/
private Integer dt;
@ApiModelProperty("数据插入时间")
@TableField("insert_time")
/**
* 数据插入时间
*/
private LocalDateTime insertTime;
}
package net.wanji.opt.entity.judgeanalysis;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* <p>
* 绿波问题分析
* </p>
*
* @author fengyi
* @since 2025-03-10
*/
@Getter
@Setter
@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("t_analysis_problem_green_day")
@ApiModel(value = "AnalysisProblemGreenDay对象", description = "绿波问题分析")
public class AnalysisProblemGreenDay extends AnalysisProblemCrossDay implements Serializable {
public class AnalysisProblemGreenDay implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private String id;
/**
* 区域ID
*/
private String areaId;
/**
* 事件一级类别 1:机动车事件 2:非机动车事件 3:行人事件 4:路口事件
*/
private String eventCategory;
/**
* 二级类别
*/
private String eventType;
@ApiModelProperty("干线id")
@TableField("green_id")
/**
* 事件发生总数量
*/
private Integer eventNumber;
/**
* 事件发生总时长
*/
private Integer eventTotalTime;
/**
* 统计窗口的开始时间
*/
private LocalDateTime windowStartTime;
/**
* 统计窗口的结束时间
*/
private LocalDateTime windowEndTime;
/**
* 干线id
*/
private Integer greenId;
/**
* 格式:yyyy-MM-dd
*/
private Integer dt;
/**
* 数据插入时间
*/
private LocalDateTime insertTime;
}
<?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="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper">
<!-- 通用设置 -->
<!-- 通用查询列 -->
<sql id="Base_Column_List">
id, area_id, event_category, event_type, event_number, event_total_time, window_start_time, window_end_time, cross_id, dt, insert_time
</sql>
<!-- 通用条件列 -->
<sql id="AnalysisProblemCrossDayByCondition">
<if test="id!=null and id!=''">
AND id = #{id}
</if>
<if test="areaId!=null and areaId!=''">
AND area_id = #{areaId}
</if>
<if test="eventCategory!=null and eventCategory!=''">
AND event_category = #{eventCategory}
</if>
<if test="eventType!=null and eventType!=''">
AND event_type = #{eventType}
</if>
<if test="eventNumber!=null and eventNumber!=''">
AND event_number = #{eventNumber}
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
AND event_total_time = #{eventTotalTime}
</if>
<if test="windowStartTime!=null">
AND window_start_time = #{windowStartTime}
</if>
<if test="windowEndTime!=null">
AND window_end_time = #{windowEndTime}
</if>
<if test="crossId!=null and crossId!=''">
AND cross_id = #{crossId}
</if>
<if test="dt!=null and dt!=''">
AND dt = #{dt}
</if>
<if test="insertTime!=null">
AND insert_time = #{insertTime}
</if>
</sql>
<!-- 通用设置列 -->
<sql id="AnalysisProblemCrossDaySetColumns">
<if test="areaId!=null and areaId!=''">
area_id = #{areaId},
</if>
<if test="eventCategory!=null and eventCategory!=''">
event_category = #{eventCategory},
</if>
<if test="eventType!=null and eventType!=''">
event_type = #{eventType},
</if>
<if test="eventNumber!=null and eventNumber!=''">
event_number = #{eventNumber},
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
event_total_time = #{eventTotalTime},
</if>
<if test="windowStartTime!=null">
window_start_time = #{windowStartTime},
</if>
<if test="windowEndTime!=null">
window_end_time = #{windowEndTime},
</if>
<if test="crossId!=null and crossId!=''">
cross_id = #{crossId},
</if>
<if test="dt!=null and dt!=''">
dt = #{dt},
</if>
<if test="insertTime!=null">
insert_time = #{insertTime},
</if>
</sql>
<!-- 通用查询映射结果 -->
<resultMap id="AnalysisProblemCrossDayMap" type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay">
<id column="id" property="id"/>
<result column="area_id" property="areaId"/>
<result column="event_category" property="eventCategory"/>
<result column="event_type" property="eventType"/>
<result column="event_number" property="eventNumber"/>
<result column="event_total_time" property="eventTotalTime"/>
<result column="window_start_time" property="windowStartTime"/>
<result column="window_end_time" property="windowEndTime"/>
<result column="cross_id" property="crossId"/>
<result column="dt" property="dt"/>
<result column="insert_time" property="insertTime"/>
</resultMap>
<!-- 查询表t_analysis_problem_cross_day所有信息 -->
<select id="findAllAnalysisProblemCrossDay" resultMap="AnalysisProblemCrossDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_cross_day
</select>
<!-- 根据主键id查询表t_analysis_problem_cross_day信息 -->
<select id="findAnalysisProblemCrossDayByid" resultMap="AnalysisProblemCrossDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_cross_day
WHERE id=#{id}
</select>
<!-- 根据条件查询表t_analysis_problem_cross_day信息 -->
<select id="findAnalysisProblemCrossDayByCondition" resultMap="AnalysisProblemCrossDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_cross_day
WHERE 1=1
<include refid="AnalysisProblemCrossDayByCondition" />
</select>
<!-- 根据主键id删除表t_analysis_problem_cross_day信息 -->
<delete id="deleteAnalysisProblemCrossDayByid">
DELETE FROM
t_analysis_problem_cross_day
WHERE id=#{id}
</delete>
<!-- 根据主键id更新表t_analysis_problem_cross_day信息 -->
<update id="updateAnalysisProblemCrossDayByid" parameterType="net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay">
UPDATE t_analysis_problem_cross_day
<set>
<include refid="AnalysisProblemCrossDaySetColumns"/>
</set>
WHERE
id=#{id}
</update>
<!-- 新增表t_analysis_problem_cross_day信息 -->
<insert id="addAnalysisProblemCrossDay">
INSERT INTO t_analysis_problem_cross_day (
id
,area_id
,event_category
,event_type
,event_number
,event_total_time
,window_start_time
,window_end_time
,cross_id
,dt
,insert_time
) VALUES (
#{id}
,#{areaId}
,#{eventCategory}
,#{eventType}
,#{eventNumber}
,#{eventTotalTime}
,#{windowStartTime}
,#{windowEndTime}
,#{crossId}
,#{dt}
,#{insertTime}
)
</insert>
</mapper>
<?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="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemGreenDayMapper">
<!-- 通用设置 -->
<!-- 通用查询列 -->
<sql id="Base_Column_List">
id, area_id, event_category, event_type, event_number, event_total_time, window_start_time, window_end_time, green_id, dt, insert_time
</sql>
<!-- 通用条件列 -->
<sql id="AnalysisProblemGreenDayByCondition">
<if test="id!=null and id!=''">
AND id = #{id}
</if>
<if test="areaId!=null and areaId!=''">
AND area_id = #{areaId}
</if>
<if test="eventCategory!=null and eventCategory!=''">
AND event_category = #{eventCategory}
</if>
<if test="eventType!=null and eventType!=''">
AND event_type = #{eventType}
</if>
<if test="eventNumber!=null and eventNumber!=''">
AND event_number = #{eventNumber}
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
AND event_total_time = #{eventTotalTime}
</if>
<if test="windowStartTime!=null">
AND window_start_time = #{windowStartTime}
</if>
<if test="windowEndTime!=null">
AND window_end_time = #{windowEndTime}
</if>
<if test="greenId!=null and greenId!=''">
AND green_id = #{greenId}
</if>
<if test="dt!=null and dt!=''">
AND dt = #{dt}
</if>
<if test="insertTime!=null">
AND insert_time = #{insertTime}
</if>
</sql>
<!-- 通用设置列 -->
<sql id="AnalysisProblemGreenDaySetColumns">
<if test="areaId!=null and areaId!=''">
area_id = #{areaId},
</if>
<if test="eventCategory!=null and eventCategory!=''">
event_category = #{eventCategory},
</if>
<if test="eventType!=null and eventType!=''">
event_type = #{eventType},
</if>
<if test="eventNumber!=null and eventNumber!=''">
event_number = #{eventNumber},
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
event_total_time = #{eventTotalTime},
</if>
<if test="windowStartTime!=null">
window_start_time = #{windowStartTime},
</if>
<if test="windowEndTime!=null">
window_end_time = #{windowEndTime},
</if>
<if test="greenId!=null and greenId!=''">
green_id = #{greenId},
</if>
<if test="dt!=null and dt!=''">
dt = #{dt},
</if>
<if test="insertTime!=null">
insert_time = #{insertTime},
</if>
</sql>
<!-- 通用查询映射结果 -->
<resultMap id="AnalysisProblemGreenDayMap" type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay">
<id column="id" property="id"/>
<result column="area_id" property="areaId"/>
<result column="event_category" property="eventCategory"/>
<result column="event_type" property="eventType"/>
<result column="event_number" property="eventNumber"/>
<result column="event_total_time" property="eventTotalTime"/>
<result column="window_start_time" property="windowStartTime"/>
<result column="window_end_time" property="windowEndTime"/>
<result column="green_id" property="greenId"/>
<result column="dt" property="dt"/>
<result column="insert_time" property="insertTime"/>
</resultMap>
<!-- 查询表t_analysis_problem_green_day所有信息 -->
<select id="findAllAnalysisProblemGreenDay" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
</select>
<!-- 根据主键id查询表t_analysis_problem_green_day信息 -->
<select id="findAnalysisProblemGreenDayByid" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
WHERE id=#{id}
</select>
<!-- 根据条件查询表t_analysis_problem_green_day信息 -->
<select id="findAnalysisProblemGreenDayByCondition" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
WHERE 1=1
<include refid="AnalysisProblemGreenDayByCondition" />
</select>
<!-- 根据主键id删除表t_analysis_problem_green_day信息 -->
<delete id="deleteAnalysisProblemGreenDayByid">
DELETE FROM
t_analysis_problem_green_day
WHERE id=#{id}
</delete>
<!-- 根据主键id更新表t_analysis_problem_green_day信息 -->
<update id="updateAnalysisProblemGreenDayByid" parameterType="net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay">
UPDATE t_analysis_problem_green_day
<set>
<include refid="AnalysisProblemGreenDaySetColumns"/>
</set>
WHERE
id=#{id}
</update>
<!-- 新增表t_analysis_problem_green_day信息 -->
<insert id="addAnalysisProblemGreenDay">
INSERT INTO t_analysis_problem_green_day (
id
,area_id
,event_category
,event_type
,event_number
,event_total_time
,window_start_time
,window_end_time
,green_id
,dt
,insert_time
) VALUES (
#{id}
,#{areaId}
,#{eventCategory}
,#{eventType}
,#{eventNumber}
,#{eventTotalTime}
,#{windowStartTime}
,#{windowEndTime}
,#{greenId}
,#{dt}
,#{insertTime}
)
</insert>
</mapper>
package net.wanji.opt.servicev2.judgeanalysis;
import com.baomidou.mybatisplus.extension.service.IService;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
......@@ -11,7 +12,7 @@ import java.util.List;
* </p>
*
* @author fengyi
* @since 2025-03-12
* @since 2025-03-13
*/
public interface AnalysisProblemCrossDayService extends IService<AnalysisProblemCrossDay> {
......
package net.wanji.opt.servicev2.judgeanalysis;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* <p>
* 绿波问题分析 服务类
* </p>
*
* @author fengyi
* @since 2025-03-13
*/
public interface AnalysisProblemGreenDayService extends IService<AnalysisProblemGreenDay> {
/**
* 绿波问题分析详情
* @param id
* @return
*/
AnalysisProblemGreenDay info(Long id);
/**
* 绿波问题分析新增
* @param param 根据需要进行传值
* @return
*/
void add(AnalysisProblemGreenDay param);
/**
* 绿波问题分析修改
* @param param 根据需要进行传值
* @return
*/
void modify(AnalysisProblemGreenDay param);
/**
* 绿波问题分析删除(单个条目)
* @param id
* @return
*/
void remove(Long id);
/**
* 删除(多个条目)
* @param ids
* @return
*/
void removes(List<Long> ids);
}
package net.wanji.opt.servicev2.judgeanalysis.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay;
import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemCrossDayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
......@@ -15,7 +18,7 @@ import java.util.List;
* </p>
*
* @author fengyi
* @since 2025-03-12
* @since 2025-03-13
*/
@Service
public class AnalysisProblemCrossDayServiceImpl extends ServiceImpl<AnalysisProblemCrossDayMapper, AnalysisProblemCrossDay> implements AnalysisProblemCrossDayService {
......
package net.wanji.opt.servicev2.judgeanalysis.impl;
import net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay;
import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemGreenDayMapper;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemGreenDayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 绿波问题分析 服务实现类
* </p>
*
* @author fengyi
* @since 2025-03-13
*/
@Service
public class AnalysisProblemGreenDayServiceImpl extends ServiceImpl<AnalysisProblemGreenDayMapper, AnalysisProblemGreenDay> implements AnalysisProblemGreenDayService {
@Resource
private AnalysisProblemGreenDayMapper analysisProblemGreenDayMapper;
/**
* 绿波问题分析详情
* @param id
* @return
*/
@Override
public AnalysisProblemGreenDay info(Long id) {
return getById(id);
}
/**
* 绿波问题分析新增
* @param param 根据需要进行传值
* @return
*/
@Override
public void add(AnalysisProblemGreenDay param) {
save(param);
}
/**
* 绿波问题分析修改
* @param param 根据需要进行传值
* @return
*/
@Override
public void modify(AnalysisProblemGreenDay param) {
updateById(param);
}
/**
* 绿波问题分析删除(单个条目)
* @param id
* @return
*/
@Override
public void remove(Long id) {
removeById(id);
}
/**
* 绿波问题分析删除(多个条目)
* @param ids
* @return
*/
@Override
public void removes(List<Long> ids) {
removeByIds(ids);
}
}
spring:
application:
# dubbo启动需要程序名称
name: signal-optimize-service
elasticsearch:
username: elastic
password: Wanji300552
......@@ -13,7 +10,7 @@ spring:
master:
type: com.alibaba.druid.pool.DruidDataSource
#url: jdbc:mysql://37.12.182.29:3306/wjdit_ecosystem_db_v1.0.0?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useSSL=false&useCursorFetch=true
url: jdbc:mysql://37.12.182.29:3306/wjdit_ecosystem_db_v1.0.0?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useSSL=false&useCursorFetch=true
url: jdbc:mysql://localhost:3306/wjdit_ecosystem_db_v1.0.0?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useSSL=false&useCursorFetch=true
username: root
password: Wanji300552
driverClassName: com.mysql.cj.jdbc.Driver
......
<?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="net.wanji.opt.dao.mapper.trend.AnalysisProblemCrossDayMapper">
<mapper namespace="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper">
<!-- 通用设置 -->
<!-- 通用查询列 -->
<sql id="Base_Column_List">
id, area_id, event_category, event_type, event_number, event_total_time, window_start_time, window_end_time, cross_id, dt, insert_time
</sql>
<!-- 通用条件列 -->
<sql id="AnalysisProblemCrossDayByCondition">
<if test="id!=null and id!=''">
AND id = #{id}
</if>
<if test="areaId!=null and areaId!=''">
AND area_id = #{areaId}
</if>
<if test="eventCategory!=null and eventCategory!=''">
AND event_category = #{eventCategory}
</if>
<if test="eventType!=null and eventType!=''">
AND event_type = #{eventType}
</if>
<if test="eventNumber!=null and eventNumber!=''">
AND event_number = #{eventNumber}
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
AND event_total_time = #{eventTotalTime}
</if>
<if test="windowStartTime!=null">
AND window_start_time = #{windowStartTime}
</if>
<if test="windowEndTime!=null">
AND window_end_time = #{windowEndTime}
</if>
<if test="crossId!=null and crossId!=''">
AND cross_id = #{crossId}
</if>
<if test="dt!=null and dt!=''">
AND dt = #{dt}
</if>
<if test="insertTime!=null">
AND insert_time = #{insertTime}
</if>
</sql>
<!-- 通用设置列 -->
<sql id="AnalysisProblemCrossDaySetColumns">
<if test="areaId!=null and areaId!=''">
area_id = #{areaId},
</if>
<if test="eventCategory!=null and eventCategory!=''">
event_category = #{eventCategory},
</if>
<if test="eventType!=null and eventType!=''">
event_type = #{eventType},
</if>
<if test="eventNumber!=null and eventNumber!=''">
event_number = #{eventNumber},
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
event_total_time = #{eventTotalTime},
</if>
<if test="windowStartTime!=null">
window_start_time = #{windowStartTime},
</if>
<if test="windowEndTime!=null">
window_end_time = #{windowEndTime},
</if>
<if test="crossId!=null and crossId!=''">
cross_id = #{crossId},
</if>
<if test="dt!=null and dt!=''">
dt = #{dt},
</if>
<if test="insertTime!=null">
insert_time = #{insertTime},
</if>
</sql>
<!-- 通用查询映射结果 -->
<resultMap id="AnalysisProblemCrossDayMap" type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemCrossDay">
......
<?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="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemGreenDayMapper">
<!-- 通用设置 -->
<!-- 通用查询列 -->
<sql id="Base_Column_List">
id, area_id, event_category, event_type, event_number, event_total_time, window_start_time, window_end_time, green_id, dt, insert_time
</sql>
<!-- 通用条件列 -->
<sql id="AnalysisProblemGreenDayByCondition">
<if test="id!=null and id!=''">
AND id = #{id}
</if>
<if test="areaId!=null and areaId!=''">
AND area_id = #{areaId}
</if>
<if test="eventCategory!=null and eventCategory!=''">
AND event_category = #{eventCategory}
</if>
<if test="eventType!=null and eventType!=''">
AND event_type = #{eventType}
</if>
<if test="eventNumber!=null and eventNumber!=''">
AND event_number = #{eventNumber}
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
AND event_total_time = #{eventTotalTime}
</if>
<if test="windowStartTime!=null">
AND window_start_time = #{windowStartTime}
</if>
<if test="windowEndTime!=null">
AND window_end_time = #{windowEndTime}
</if>
<if test="greenId!=null and greenId!=''">
AND green_id = #{greenId}
</if>
<if test="dt!=null and dt!=''">
AND dt = #{dt}
</if>
<if test="insertTime!=null">
AND insert_time = #{insertTime}
</if>
</sql>
<!-- 通用设置列 -->
<sql id="AnalysisProblemGreenDaySetColumns">
<if test="areaId!=null and areaId!=''">
area_id = #{areaId},
</if>
<if test="eventCategory!=null and eventCategory!=''">
event_category = #{eventCategory},
</if>
<if test="eventType!=null and eventType!=''">
event_type = #{eventType},
</if>
<if test="eventNumber!=null and eventNumber!=''">
event_number = #{eventNumber},
</if>
<if test="eventTotalTime!=null and eventTotalTime!=''">
event_total_time = #{eventTotalTime},
</if>
<if test="windowStartTime!=null">
window_start_time = #{windowStartTime},
</if>
<if test="windowEndTime!=null">
window_end_time = #{windowEndTime},
</if>
<if test="greenId!=null and greenId!=''">
green_id = #{greenId},
</if>
<if test="dt!=null and dt!=''">
dt = #{dt},
</if>
<if test="insertTime!=null">
insert_time = #{insertTime},
</if>
</sql>
<!-- 通用查询映射结果 -->
<resultMap id="AnalysisProblemGreenDayMap" type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay">
<id column="id" property="id"/>
<result column="area_id" property="areaId"/>
<result column="event_category" property="eventCategory"/>
<result column="event_type" property="eventType"/>
<result column="event_number" property="eventNumber"/>
<result column="event_total_time" property="eventTotalTime"/>
<result column="window_start_time" property="windowStartTime"/>
<result column="window_end_time" property="windowEndTime"/>
<result column="green_id" property="greenId"/>
<result column="dt" property="dt"/>
<result column="insert_time" property="insertTime"/>
</resultMap>
<!-- 查询表t_analysis_problem_green_day所有信息 -->
<select id="findAllAnalysisProblemGreenDay" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
</select>
<!-- 根据主键id查询表t_analysis_problem_green_day信息 -->
<select id="findAnalysisProblemGreenDayByid" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
WHERE id=#{id}
</select>
<!-- 根据条件查询表t_analysis_problem_green_day信息 -->
<select id="findAnalysisProblemGreenDayByCondition" resultMap="AnalysisProblemGreenDayMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_analysis_problem_green_day
WHERE 1=1
<include refid="AnalysisProblemGreenDayByCondition" />
</select>
<!-- 根据主键id删除表t_analysis_problem_green_day信息 -->
<delete id="deleteAnalysisProblemGreenDayByid">
DELETE FROM
t_analysis_problem_green_day
WHERE id=#{id}
</delete>
<!-- 根据主键id更新表t_analysis_problem_green_day信息 -->
<update id="updateAnalysisProblemGreenDayByid" parameterType="net.wanji.opt.entity.judgeanalysis.AnalysisProblemGreenDay">
UPDATE t_analysis_problem_green_day
<set>
<include refid="AnalysisProblemGreenDaySetColumns"/>
</set>
WHERE
id=#{id}
</update>
<!-- 新增表t_analysis_problem_green_day信息 -->
<insert id="addAnalysisProblemGreenDay">
INSERT INTO t_analysis_problem_green_day (
id
,area_id
,event_category
,event_type
,event_number
,event_total_time
,window_start_time
,window_end_time
,green_id
,dt
,insert_time
) VALUES (
#{id}
,#{areaId}
,#{eventCategory}
,#{eventType}
,#{eventNumber}
,#{eventTotalTime}
,#{windowStartTime}
,#{windowEndTime}
,#{greenId}
,#{dt}
,#{insertTime}
)
</insert>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment