Merge remote-tracking branch 'origin/master'

jni
18616268358 2 years ago
commit 6294e02b06

@ -7,10 +7,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.LineListModel; import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.DyLineTreeListModel; import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.vo.LineIdVo; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
import com.shxy.xymanager_service.service.LineService; import com.shxy.xymanager_service.service.LineService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -84,4 +81,18 @@ public class LineController extends BaseController {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
} }
} }
@ApiOperation(value = "线路杆塔通道查询", notes = "线路杆塔通道查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getLineAndGt")
@Log(title = "线路杆塔通道查询", type = "查询")
public ResponseReult<String> getLineAndGt(@RequestBody @Validated LineAndGtAndChannelVo vo) {
ServiceBody<String> serviceBody = lineService.getLineAndGt(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
} }

@ -37,7 +37,7 @@ public class TerminalPhotoController extends BaseController {
@ApiOperation(value = "获取图片列表", notes = "获取图片列表接口", httpMethod = "POST") @ApiOperation(value = "获取图片列表", notes = "获取图片列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTerminalPhotoList") @RequestMapping("/getTerminalPhotoList")
@Log(title = "获取设备列表", type = "查询") @Log(title = "获取图片列表", type = "查询")
public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdAndTimeVo vo) { public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdAndTimeVo vo) {
ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo); ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {

@ -47,7 +47,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getSingleScheduleRule") @RequestMapping("/getSingleScheduleRule")
@Log(title = "获取单个任务规则", type = "查询") @Log(title = "获取单个任务规则", type = "查询")
public ResponseReult<TerminalScheduleRuleModel> getSingleScheduleRule(@RequestBody @Validated TerminalRuleIdVo vo) { public ResponseReult<TerminalScheduleRuleModel> getSingleScheduleRule(@RequestBody @Validated ScheduleIdVo vo) {
ServiceBody<TerminalScheduleRuleModel> serviceBody = terminalScheduleRuleService.getSingleScheduleRule(vo); ServiceBody<TerminalScheduleRuleModel> serviceBody = terminalScheduleRuleService.getSingleScheduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
@ -60,7 +60,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addSchelduleRuleList") @RequestMapping("/addSchelduleRuleList")
@Log(title = "添加任务规则列表", type = "新增") @Log(title = "添加任务规则列表", type = "新增")
public ResponseReult<String> addSchedulelRuleList(@RequestBody @Validated TerminalRuleListVo vo) { public ResponseReult<String> addSchedulelRuleList(@RequestBody @Validated ScheduleListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.addSchedulelRuleList(vo); ServiceBody<String> serviceBody = terminalScheduleRuleService.addSchedulelRuleList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
@ -73,7 +73,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/updateSchelduleRule") @RequestMapping("/updateSchelduleRule")
@Log(title = "修改任务规则", type = "修改") @Log(title = "修改任务规则", type = "修改")
public ResponseReult<String> updateSchelduleRule(@RequestBody @Validated TerminalRuleVo vo) { public ResponseReult<String> updateSchelduleRule(@RequestBody @Validated UpdateScheduleListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.updateSchelduleRule(vo); ServiceBody<String> serviceBody = terminalScheduleRuleService.updateSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
@ -86,7 +86,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/deleteSchelduleRule") @RequestMapping("/deleteSchelduleRule")
@Log(title = "删除任务规则", type = "修改") @Log(title = "删除任务规则", type = "修改")
public ResponseReult<String> deleteSchelduleRule(@RequestBody @Validated TerminalRuleIdListVo vo) { public ResponseReult<String> deleteSchelduleRule(@RequestBody @Validated ScheduleIdListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.deleteSchelduleRule(vo); ServiceBody<String> serviceBody = terminalScheduleRuleService.deleteSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class ScheduleAndRuleDto implements Serializable {
private Integer id;
private String name;
private String remark;
private Integer status;
private List<ScheduleRuleDto> list;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
@Data
public class ScheduleRuleDto implements Serializable {
private Integer id;
private Integer scheduleId;
private Time startTime;
private Time endTime;
private Integer span;
private static final long serialVersionUID = 1L;
}

@ -28,8 +28,6 @@ public class TerminalPhoto implements Serializable {
private String path; private String path;
private Integer manualRequest;
private Date createTime; private Date createTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -3,21 +3,18 @@ package com.shxy.xymanager_common.entity;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Time;
import java.util.Date; import java.util.Date;
@Data @Data
public class TerminalSchedule implements Serializable { public class TerminalSchedule implements Serializable {
private Integer id; private Integer id;
private Integer termId; private String name;
private Byte channelId; private String remark;
private Byte hour; private Integer status;
private Byte minute;
private Integer presetId;
private Date createTime; private Date createTime;

@ -11,7 +11,7 @@ public class TerminalScheduleRule implements Serializable {
private Integer id; private Integer id;
private String name; private Integer scheduleId;
private Time startTime; private Time startTime;
@ -19,10 +19,6 @@ public class TerminalScheduleRule implements Serializable {
private Integer span; private Integer span;
private String remark;
private Integer status;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;

@ -25,10 +25,10 @@ public class TerminalScheduleRuleListModel implements Serializable {
private int pagesize; private int pagesize;
@ApiModelProperty(value = "时间任务列表", example = "[]") @ApiModelProperty(value = "时间任务列表", example = "[]")
private List<ScheduleRuleBean> list; private List<ScheduleBean> list;
@Data @Data
public static class ScheduleRuleBean { public static class ScheduleBean {
@ApiModelProperty(value = "任务编号", example = "123456") @ApiModelProperty(value = "任务编号", example = "123456")
private Integer id; private Integer id;
@ -36,6 +36,22 @@ public class TerminalScheduleRuleListModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456") @ApiModelProperty(value = "任务名称", example = "123456")
private String name; private String name;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
@ApiModelProperty(value = "时间任务详情列表", example = "erwsafsasa")
private List<ScheduleRuleBean> list;
}
@Data
public static class ScheduleRuleBean {
@ApiModelProperty(value = "任务详情编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "任务规则编号", example = "123456")
private Integer scheduleId;
@ApiModelProperty(value = "间隔", example = "213") @ApiModelProperty(value = "间隔", example = "213")
private Integer span; private Integer span;
@ -44,9 +60,5 @@ public class TerminalScheduleRuleListModel implements Serializable {
@ApiModelProperty(value = "结束时间", example = "2022-06-08") @ApiModelProperty(value = "结束时间", example = "2022-06-08")
private Time endTime; private Time endTime;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
} }
} }

@ -21,16 +21,27 @@ public class TerminalScheduleRuleModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456") @ApiModelProperty(value = "任务名称", example = "123456")
private String name; private String name;
@ApiModelProperty(value = "间隔", example = "213") @ApiModelProperty(value = "备注", example = "erwsafsasa")
private Integer span; private String remark;
@ApiModelProperty(value = "开始时间", example = "2022-06-08") @ApiModelProperty(value = "时间任务详情列表", example = "erwsafsasa")
private Time startTime; private List<ScheduleRuleBean> list;
@ApiModelProperty(value = "结束时间", example = "2022-06-08") @Data
private Time endTime; public static class ScheduleRuleBean {
@ApiModelProperty(value = "任务详情编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "备注", example = "erwsafsasa") @ApiModelProperty(value = "任务规则编号", example = "123456")
private String remark; private Integer scheduleId;
@ApiModelProperty(value = "间隔", example = "213")
private Integer span;
@ApiModelProperty(value = "开始时间", example = "2022-06-08")
private Time startTime;
@ApiModelProperty(value = "结束时间", example = "2022-06-08")
private Time endTime;
}
} }

@ -0,0 +1,29 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "线路杆塔通道和时间查询", description = "线路杆塔通道和时间查询")
public class LineAndGtAndChannelVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer dyid;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer lineid;
@ApiModelProperty(value = "杆塔编号", example = "123455")
private Integer towerid;
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelid;
@ApiModelProperty(value = "查询时间", example = "123455")
private Date time;
}

@ -17,7 +17,7 @@ public class RelateTerminalListRuleIdVo {
@NotNull(message = "规则编号不能缺少") @NotNull(message = "规则编号不能缺少")
@ApiModelProperty(value = "规则编号", example = "123455") @ApiModelProperty(value = "规则编号", example = "123455")
private Integer ruleid; private Integer scheduleid;
@NotNull(message = "装置列表不能缺少") @NotNull(message = "装置列表不能缺少")
@ApiModelProperty(value = "装置通道编号列表", example = "123455") @ApiModelProperty(value = "装置通道编号列表", example = "123455")

@ -5,13 +5,12 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@Data @Data
@ApiModel(value = "任务规则编号列表", description = "任务规则编号列表描述") @ApiModel(value = "任务规则编号列表", description = "任务规则编号列表描述")
public class TerminalRuleIdListVo { public class ScheduleIdListVo {
@NotEmpty(message = "不能传入空值") @NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001") @ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<TerminalRuleIdVo> list; private List<ScheduleIdVo> list;
} }

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "任务规则编号对象", description = "任务规则编号对象描述") @ApiModel(value = "任务规则编号对象", description = "任务规则编号对象描述")
public class TerminalRuleIdVo { public class ScheduleIdVo {
@NotNull(message = "规则编号不能缺少") @NotNull(message = "规则编号不能缺少")
@ApiModelProperty(value = "规则编号", example = "123455") @ApiModelProperty(value = "规则编号", example = "123455")

@ -0,0 +1,25 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "任务规则对象", description = "任务规则对象列表描述")
public class ScheduleListVo {
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<ScheduleRuleVo> list;
@ApiModelProperty(value = "备注", example = "型号型号")
private String remark;
}

@ -10,15 +10,8 @@ import java.sql.Time;
import java.util.List; import java.util.List;
@Data @Data
@ApiModel(value = "任务规则对象", description = "任务规则对象描述") @ApiModel(value = "任务规则对象详情", description = "任务规则对象详情描述")
public class TerminalRuleVo { public class ScheduleRuleVo {
@ApiModelProperty(value = "任务规则编号", example = "名称名称")
@NotBlank(message = "任务编号不能缺少")
private Integer id;
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@ApiModelProperty(value = "开始时间", example = "单位") @ApiModelProperty(value = "开始时间", example = "单位")
@NotBlank(message = "开始时间不能缺少") @NotBlank(message = "开始时间不能缺少")
@ -32,8 +25,5 @@ public class TerminalRuleVo {
@NotBlank(message = "时间间隔不能缺少") @NotBlank(message = "时间间隔不能缺少")
private Integer span; private Integer span;
@ApiModelProperty(value = "备注", example = "型号型号")
@NotBlank(message = "时间间隔不能缺少")
private String remark;
} }

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -1,18 +0,0 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "任务规则对象列表", description = "任务规则对象列表描述")
public class TerminalRuleListVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<TerminalRuleVo> list;
}

@ -0,0 +1,32 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "修改任务规则对象", description = "修改任务规则对象描述")
public class UpdateScheduleListVo {
@ApiModelProperty(value = "任务规则编号", example = "任务规则编号")
@NotBlank(message = "任务规则编号不能缺少")
private Integer id;
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<ScheduleRuleVo> list;
@ApiModelProperty(value = "备注", example = "型号型号")
private String remark;
// @ApiModelProperty(value = "任务规则状态", example = "名称名称")
// @NotBlank(message = "任务规则状态不能缺少")
// private Integer status;
}

@ -17,6 +17,8 @@ public interface LinesDao {
Lines selectByPrimaryKey(Integer id); Lines selectByPrimaryKey(Integer id);
Lines selectLineAndGt(Integer id);
int updateByPrimaryKeySelective(@Param("data") Lines record, @Param("updateat") Date update); int updateByPrimaryKeySelective(@Param("data") Lines record, @Param("updateat") Date update);
int updateByPrimaryKey(Lines record); int updateByPrimaryKey(Lines record);

@ -1,8 +1,20 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.ScheduleAndRuleDto;
import com.shxy.xymanager_common.entity.TerminalSchedule; import com.shxy.xymanager_common.entity.TerminalSchedule;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalScheduleDao { public interface TerminalScheduleDao {
List<ScheduleAndRuleDto> selectAll(@Param("status") Integer status);
ScheduleAndRuleDto selectSingle(@Param("id") Integer id, @Param("status") Integer status);
int updateStatusById(@Param("list") List<TerminalSchedule> list, @Param("status") Integer status, @Param("updateat") Date update);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(TerminalSchedule record); int insert(TerminalSchedule record);

@ -10,13 +10,15 @@ public interface TerminalScheduleRuleDao {
int insertSelective(TerminalScheduleRule record); int insertSelective(TerminalScheduleRule record);
int insertList(@Param("list") List<TerminalScheduleRule> record, @Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update); int insertList(@Param("list") List<TerminalScheduleRule> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalScheduleRule selectByPrimaryKey(Integer id); TerminalScheduleRule selectByPrimaryKey(Integer id);
List<TerminalScheduleRule> selectAll(@Param("status") Integer status); List<TerminalScheduleRule> selectAll(@Param("status") Integer status);
int deleteById(@Param("list") List<TerminalScheduleRule> record, @Param("status") Integer status,@Param("updateat") Date update);
int deleteById(@Param("scheduleid") Integer id);
int updateByPrimaryKeySelective(@Param("data") TerminalScheduleRule record,@Param("updateat") Date update); int updateByPrimaryKeySelective(@Param("data") TerminalScheduleRule record,@Param("updateat") Date update);

@ -112,7 +112,7 @@
<!-- </table>--> <!-- </table>-->
<!-- <table tableName="terminal_schedulemapper"--> <!-- <table tableName="terminal_schedule_mapper"-->
<!-- domainObjectName="TerminalScheduleMapper"--> <!-- domainObjectName="TerminalScheduleMapper"-->
<!-- mapperName="TerminalScheduleMapperDao"--> <!-- mapperName="TerminalScheduleMapperDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"--> <!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
@ -120,7 +120,7 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;--> <!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>--> <!-- </table>-->
<!-- <table tableName="terminal_schedulerule"--> <!-- <table tableName="terminal_schedule_rule"-->
<!-- domainObjectName="TerminalScheduleRule"--> <!-- domainObjectName="TerminalScheduleRule"-->
<!-- mapperName="TerminalScheduleRuleDao"--> <!-- mapperName="TerminalScheduleRuleDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"--> <!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->

@ -62,10 +62,8 @@
y.equip_name as equip_name, y.equip_name as equip_name,
y.display_name as display_name, y.display_name as display_name,
y.model as model y.model as model
from `lines` x, from ((dy_level z join `lines` x on z.id = x.dy_level_id and x.status = #{status} and z.status = #{status})
terminals y, join terminals y on x.id = y.line_id and y.status = #{status})
dy_level z
where z.id = x.dy_level_id and x.id = y.line_id and x.status = #{status} and y.status = #{status} and z.status = #{status}
</select> </select>

@ -74,32 +74,6 @@
</if> </if>
</select> </select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap"> <select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
<!-- select-->
<!-- z.id as id,-->
<!-- z.name as name,-->
<!-- z.dy_value as dyvalue,-->
<!-- x.id as line_id,-->
<!-- x.name as line_name,-->
<!-- x.bs_manufacturer as bs_manufacturer,-->
<!-- y.id as term_id,-->
<!-- y.tower_id as tower_id,-->
<!-- y.cmdid as cmdid,-->
<!-- y.display_name as display_name,-->
<!-- k.id as channel_id,-->
<!-- k.channel_name as channel_name,-->
<!-- l.schedule_id as schedule_id-->
<!-- from `lines` x,-->
<!-- terminals y,-->
<!-- dy_level z,-->
<!-- terminal_channel_mapper j,-->
<!-- terminal_channels k,-->
<!-- terminal_schedulemapper l-->
<!-- where z.id = x.dy_level_id and x.id = y.line_id and j.term_id = y.id and j.channel_id = k.id and y.id = l.term_id and j.channel_id = l.channel_id-->
<!-- and x.status = #{status} and y.status = #{status} and z.status = #{status} and k.status = #{status}-->
<!-- <if test="termid != null">-->
<!-- and y.id = #{termid}-->
<!-- </if>-->
SELECT SELECT
z.id AS id, z.id AS id,
z.name AS name, z.name AS name,
@ -116,15 +90,13 @@
l.schedule_id AS schedule_id l.schedule_id AS schedule_id
FROM FROM
(((((dy_level z (((((dy_level z
left JOIN `lines` x ON z.id = x.dy_level_id) left JOIN `lines` x ON z.id = x.dy_level_id and z.status = #{status} and x.status = #{status})
left JOIN terminals y ON x.id = y.line_id) left JOIN terminals y ON x.id = y.line_id and y.status = #{status})
left JOIN terminal_channel_mapper j ON j.term_id = y.id) left JOIN terminal_channel_mapper j ON j.term_id = y.id)
left JOIN terminal_channels k ON j.channel_id = k.id) left JOIN terminal_channels k ON j.channel_id = k.id and k.status = #{status})
left JOIN terminal_schedulemapper l ON j.channel_id = l.channel_id) left JOIN terminal_schedule_mapper l ON k.id = l.channel_id and l.term_id = y.id)
where
x.status = #{status} and y.status = #{status} and z.status = #{status} and k.status = #{status}
<if test="termid != null"> <if test="termid != null">
and y.id = #{termid} where y.id = #{termid}
</if> </if>
</select> </select>

@ -12,12 +12,11 @@
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/> <result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
<result column="recv_time" jdbcType="BIGINT" property="recvTime"/> <result column="recv_time" jdbcType="BIGINT" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path"/> <result column="path" jdbcType="VARCHAR" property="path"/>
<result column="manual_request" jdbcType="TINYINT" property="manualRequest"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time, id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time,
path, manual_request, create_time path, create_time
</sql> </sql>
<select id="selectPhotoList" resultMap="BaseResultMap"> <select id="selectPhotoList" resultMap="BaseResultMap">
select select
@ -62,12 +61,12 @@
insert into terminal_photos (id, term_id, channel_id, insert into terminal_photos (id, term_id, channel_id,
preset_id, width, height, preset_id, width, height,
file_size, photo_time, recv_time, file_size, photo_time, recv_time,
path, manual_request, create_time path, create_time
) )
values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER}, values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{presetId,jdbcType=TINYINT}, #{width,jdbcType=INTEGER}, #{height,jdbcType=INTEGER}, #{presetId,jdbcType=TINYINT}, #{width,jdbcType=INTEGER}, #{height,jdbcType=INTEGER},
#{fileSize,jdbcType=INTEGER}, #{photoTime,jdbcType=TIMESTAMP}, #{recvTime,jdbcType=TIMESTAMP}, #{fileSize,jdbcType=INTEGER}, #{photoTime,jdbcType=TIMESTAMP}, #{recvTime,jdbcType=TIMESTAMP},
#{path,jdbcType=VARCHAR}, #{manualRequest,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER} #{path,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
@ -103,9 +102,6 @@
<if test="path != null"> <if test="path != null">
path, path,
</if> </if>
<if test="manualRequest != null">
manual_request,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
@ -141,9 +137,6 @@
<if test="path != null"> <if test="path != null">
#{path,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR},
</if> </if>
<if test="manualRequest != null">
#{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
</if> </if>
@ -179,9 +172,6 @@
<if test="path != null"> <if test="path != null">
path = #{path,jdbcType=VARCHAR}, path = #{path,jdbcType=VARCHAR},
</if> </if>
<if test="manualRequest != null">
manual_request = #{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=INTEGER},
</if> </if>
@ -199,7 +189,6 @@
photo_time = #{photoTime,jdbcType=TIMESTAMP}, photo_time = #{photoTime,jdbcType=TIMESTAMP},
recv_time = #{recvTime,jdbcType=TIMESTAMP}, recv_time = #{recvTime,jdbcType=TIMESTAMP},
path = #{path,jdbcType=VARCHAR}, path = #{path,jdbcType=VARCHAR},
manual_request = #{manualRequest,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=INTEGER} create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>

@ -1,30 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleDao"> <mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedule"> <resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedule">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId" /> <result column="name" jdbcType="VARCHAR" property="name"/>
<result column="channel_id" jdbcType="TINYINT" property="channelId" /> <result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="hour" jdbcType="TINYINT" property="hour" /> <result column="status" jdbcType="INTEGER" property="status"/>
<result column="minute" jdbcType="TINYINT" property="minute" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="preset_id" jdbcType="INTEGER" property="presetId" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> </resultMap>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> <resultMap id="ScheduleAndRule" type="com.shxy.xymanager_common.dto.ScheduleAndRuleDto">
<sql id="Base_Column_List"> <id column="id" jdbcType="INTEGER" property="id"/>
id, term_id, channel_id, hour, minute, preset_id, create_time, update_time <result column="name" jdbcType="VARCHAR" property="name"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.ScheduleRuleDto">
<id column="ruleid" jdbcType="INTEGER" property="id"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/>
<result column="end_time" jdbcType="TIME" property="endTime"/>
<result column="span" jdbcType="INTEGER" property="span"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, name,remark,status,create_time, update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from terminal_schedule from terminal_schedule
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule <select id="selectAll" resultMap="ScheduleAndRule">
where id = #{id,jdbcType=INTEGER} select
</delete> x.id as id,
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule"> x.name as name,
x.remark as remark,
x.status as status,
y.id as ruleid,
y.schedule_id as schedule_id,
y.start_time as start_time,
y.end_time as end_time,
y.span as span
from terminal_schedule x,
terminal_schedule_rule y
where y.schedule_id = x.id and x.status = #{status}
</select>
<select id="selectSingle" resultMap="ScheduleAndRule">
select
x.id as id,
x.name as name,
x.remark as remark,
x.status as status,
y.id as ruleid,
y.schedule_id as schedule_id,
y.start_time as start_time,
y.end_time as end_time,
y.span as span
from terminal_schedule x,
terminal_schedule_rule y
where y.schedule_id = x.id and x.status = #{status} and x.id = #{id}
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
insert into terminal_schedule (id, term_id, channel_id, insert into terminal_schedule (id, term_id, channel_id,
hour, minute, preset_id, hour, minute, preset_id,
create_time, update_time) create_time, update_time)
@ -32,89 +73,74 @@
#{hour,jdbcType=TINYINT}, #{minute,jdbcType=TINYINT}, #{presetId,jdbcType=INTEGER}, #{hour,jdbcType=TINYINT}, #{minute,jdbcType=TINYINT}, #{presetId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
insert into terminal_schedule <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule" keyProperty="id">
<trim prefix="(" suffix=")" suffixOverrides=","> insert into terminal_schedule
<if test="id != null"> <trim prefix="(" suffix=")" suffixOverrides=",">
id, <if test="name != null">
</if> name,
<if test="termId != null"> </if>
term_id, <if test="remark != null">
</if> remark,
<if test="channelId != null"> </if>
channel_id, <if test="status != null">
</if> status,
<if test="hour != null"> </if>
hour, <if test="createTime != null">
</if> create_time,
<if test="minute != null"> </if>
minute, <if test="updateTime != null">
</if> update_time,
<if test="presetId != null"> </if>
preset_id, </trim>
</if> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null"> <if test="name != null">
create_time, #{name},
</if> </if>
<if test="updateTime != null"> <if test="remark != null">
update_time, #{remark},
</if> </if>
</trim> <if test="status != null">
<trim prefix="values (" suffix=")" suffixOverrides=","> #{status},
<if test="id != null"> </if>
#{id,jdbcType=INTEGER}, <if test="createTime != null">
</if> #{createTime},
<if test="termId != null"> </if>
#{termId,jdbcType=INTEGER}, <if test="updateTime != null">
</if> #{updateTime},
<if test="channelId != null"> </if>
#{channelId,jdbcType=TINYINT}, </trim>
</if> </insert>
<if test="hour != null">
#{hour,jdbcType=TINYINT}, <update id="updateStatusById">
</if> update terminal_schedule
<if test="minute != null"> set status = #{status},
#{minute,jdbcType=TINYINT}, update_time = #{updateat}
</if> where id in
<if test="presetId != null"> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{presetId,jdbcType=INTEGER}, #{item.id}
</if> </foreach>
<if test="createTime != null"> </update>
#{createTime,jdbcType=TIMESTAMP},
</if> <update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
<if test="updateTime != null"> update terminal_schedule
#{updateTime,jdbcType=TIMESTAMP}, <set>
</if> <if test="name != null">
</trim> name = #{name},
</insert> </if>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule"> <if test="remark != null">
update terminal_schedule remark = #{remark},
<set> </if>
<if test="termId != null"> <if test="status != null">
term_id = #{termId,jdbcType=INTEGER}, status = #{status},
</if> </if>
<if test="channelId != null"> <if test="updateTime != null">
channel_id = #{channelId,jdbcType=TINYINT}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="hour != null"> </set>
hour = #{hour,jdbcType=TINYINT}, where id = #{id,jdbcType=INTEGER}
</if> </update>
<if test="minute != null"> <update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
minute = #{minute,jdbcType=TINYINT},
</if>
<if test="presetId != null">
preset_id = #{presetId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
update terminal_schedule update terminal_schedule
set term_id = #{termId,jdbcType=INTEGER}, set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT}, channel_id = #{channelId,jdbcType=TINYINT},

@ -15,14 +15,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulemapper from terminal_schedule_mapper
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectByChannelId" resultMap="BaseResultMap"> <select id="selectByChannelId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulemapper from terminal_schedule_mapper
where channel_id = #{channelid} where channel_id = #{channelid}
and term_id = #{termid} and term_id = #{termid}
</select> </select>
@ -30,7 +30,7 @@
<select id="selectByTerminalBean" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByTerminalBean" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulemapper from terminal_schedule_mapper
where where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termid} and channel_id in term_id = #{item.termid} and channel_id in
@ -41,7 +41,7 @@
</select> </select>
<delete id="deleteByChannelId"> <delete id="deleteByChannelId">
delete from terminal_schedulemapper delete from terminal_schedule_mapper
where where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termId} and channel_id = #{item.channelId} term_id = #{item.termId} and channel_id = #{item.channelId}
@ -49,7 +49,7 @@
</delete> </delete>
<insert id="insertList" parameterType="java.util.List"> <insert id="insertList" parameterType="java.util.List">
insert into terminal_schedulemapper insert into terminal_schedule_mapper
(term_id,channel_id,schedule_id,create_time,update_time) (term_id,channel_id,schedule_id,create_time,update_time)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
@ -59,7 +59,7 @@
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper"> <insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedulemapper (id, term_id, channel_id, insert into terminal_schedule_mapper (id, term_id, channel_id,
schedule_id, create_time, update_time schedule_id, create_time, update_time
) )
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=TINYINT}, values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=TINYINT},
@ -67,7 +67,7 @@
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedulemapper insert into terminal_schedule_mapper
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
@ -110,7 +110,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper"> <update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedulemapper update terminal_schedule_mapper
<set> <set>
<if test="termId != null"> <if test="termId != null">
term_id = #{termId,jdbcType=INTEGER}, term_id = #{termId,jdbcType=INTEGER},
@ -131,7 +131,7 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper"> <update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedulemapper update terminal_schedule_mapper
set term_id = #{termId,jdbcType=INTEGER}, set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT}, channel_id = #{channelId,jdbcType=TINYINT},
schedule_id = #{scheduleId,jdbcType=INTEGER}, schedule_id = #{scheduleId,jdbcType=INTEGER},

@ -3,33 +3,31 @@
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao"> <mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/> <result column="start_time" jdbcType="TIME" property="startTime"/>
<result column="end_time" jdbcType="TIME" property="endTime"/> <result column="end_time" jdbcType="TIME" property="endTime"/>
<result column="span" jdbcType="INTEGER" property="span"/> <result column="span" jdbcType="INTEGER" property="span"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, start_time, end_time, span, remark, status,create_time, update_time id, schedule_id, start_time, end_time, span, create_time, update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulerule from terminal_schedule_rule
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap"> <select id="selectAll" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_schedulerule from terminal_schedule_rule
where status = #{status} where status = #{status}
</select> </select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
insert into terminal_schedulerule (id, name, start_time, insert into terminal_schedule_rule (id, name, start_time,
end_time, span, remark, end_time, span, remark,
create_time, update_time) create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIME}, values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIME},
@ -38,17 +36,17 @@
</insert> </insert>
<insert id="insertList" parameterType="java.util.List"> <insert id="insertList" parameterType="java.util.List">
insert into terminal_schedulerule insert into terminal_schedule_rule
(name,start_time,end_time,span,remark,status,create_time,update_time) (schedule_id,start_time,end_time,span,create_time,update_time)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.name},#{item.startTime},#{item.endTime},#{item.span},#{item.remark},#{status},#{createat},#{updateat}) (#{item.scheduleId},#{item.startTime},#{item.endTime},#{item.span},#{createat},#{updateat})
</foreach> </foreach>
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
insert into terminal_schedulerule insert into terminal_schedule_rule
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
@ -103,18 +101,14 @@
</trim> </trim>
</insert> </insert>
<update id="deleteById">
update terminal_schedulerule <delete id="deleteById">
set status = #{status}, delete from terminal_schedule_rule
update_time = #{updateat} where schedule_id = #{scheduleid}
where id in </delete>
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.id}
</foreach>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
update terminal_schedulerule update terminal_schedule_rule
<set> <set>
<if test="data.name != null"> <if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR}, name = #{data.name,jdbcType=VARCHAR},
@ -138,7 +132,7 @@
where id = #{data.id,jdbcType=INTEGER} where id = #{data.id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
update terminal_schedulerule update terminal_schedule_rule
set name = #{name,jdbcType=VARCHAR}, set name = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIME}, start_time = #{startTime,jdbcType=TIME},
end_time = #{endTime,jdbcType=TIME}, end_time = #{endTime,jdbcType=TIME},

@ -13,10 +13,7 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineListModel; import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.LineIdVo; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
import com.shxy.xymanager_dao.dao.LinesDao; import com.shxy.xymanager_dao.dao.LinesDao;
import com.shxy.xymanager_service.service.LineService; import com.shxy.xymanager_service.service.LineService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -129,5 +126,22 @@ public class LineServiceImpl implements LineService {
} }
} }
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> getLineAndGt(LineAndGtAndChannelVo vo) {
// Integer dyid = vo.getDyid();
// Integer lineid = vo.getLineid();
// Integer towerid = vo.getTowerid();
// vo.
// linesDao.selectByPrimaryKey()
return null;
}
} }

@ -64,7 +64,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
DateTime enddateTime = MyDateUtils.endOfDay(time); DateTime enddateTime = MyDateUtils.endOfDay(time);
BigInteger start = MyDateUtils.TimeMillSecond2Second(begindateTime); BigInteger start = MyDateUtils.TimeMillSecond2Second(begindateTime);
BigInteger end = MyDateUtils.TimeMillSecond2Second(enddateTime); BigInteger end = MyDateUtils.TimeMillSecond2Second(enddateTime);
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(), start, end); boolean empty1 = CollectionUtil.isEmpty(vo.getChannelid());
List<TerminalPhoto> list = new ArrayList<>();
if (!empty1) {
list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(), start, end);
}
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
model.setTime(vo.getTime()); model.setTime(vo.getTime());
model.setNum(list.size()); model.setNum(list.size());
@ -77,7 +81,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelId(item.getChannelId()); photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize()); photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight()); photoBean.setHeight(item.getHeight());
photoBean.setManualRequest(item.getManualRequest());
photoBean.setPath(photoaddress + item.getPath()); photoBean.setPath(photoaddress + item.getPath());
photoBean.setId(item.getId()); photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId()); photoBean.setTermId(item.getTermId());
@ -156,7 +159,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelId(item.getChannelId()); photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize()); photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight()); photoBean.setHeight(item.getHeight());
photoBean.setManualRequest(item.getManualRequest());
photoBean.setPath(photoaddress + item.getPath()); photoBean.setPath(photoaddress + item.getPath());
photoBean.setId(item.getId()); photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId()); photoBean.setTermId(item.getTermId());

@ -8,6 +8,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.ScheduleAndRuleDto;
import com.shxy.xymanager_common.entity.TerminalSchedule;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper; import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.entity.TerminalScheduleRule; import com.shxy.xymanager_common.entity.TerminalScheduleRule;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
@ -18,14 +20,17 @@ import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalScheduleDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao; import com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao; import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotBlank;
import java.sql.Time; import java.sql.Time;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -38,6 +43,9 @@ import java.util.List;
@Slf4j @Slf4j
public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleService { public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleService {
@Autowired
TerminalScheduleDao terminalScheduleDao;
@Autowired @Autowired
TerminalScheduleRuleDao terminalScheduleRuleDao; TerminalScheduleRuleDao terminalScheduleRuleDao;
@ -55,12 +63,12 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
int pageindex = vo.getPageindex(); int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize); PageUtils.SetPage(pageindex, pagesize);
List<TerminalScheduleRule> list = terminalScheduleRuleDao.selectAll(CommonStatus.EFFECTIVE.value()); List<ScheduleAndRuleDto> list = terminalScheduleDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
List<TerminalScheduleRuleListModel.ScheduleRuleBean> beans = BeanUtil.copyToList(list, TerminalScheduleRuleListModel.ScheduleRuleBean.class, CopyOptions.create().ignoreCase()); List<TerminalScheduleRuleListModel.ScheduleBean> beans = BeanUtil.copyToList(list, TerminalScheduleRuleListModel.ScheduleBean.class, CopyOptions.create().ignoreCase());
model.setList(beans); model.setList(beans);
} }
PageInfo pageData = PageUtils.getPageData(list); PageInfo pageData = PageUtils.getPageData(list);
@ -83,19 +91,13 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return * @return
*/ */
@Override @Override
public ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(TerminalRuleIdVo vo) { public ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(ScheduleIdVo vo) {
TerminalScheduleRule item = terminalScheduleRuleDao.selectByPrimaryKey(vo.getId()); ScheduleAndRuleDto bean = terminalScheduleDao.selectSingle(vo.getId(), CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(item)) { if (BeanUtil.isEmpty(bean)) {
return Asserts.error("没有该对象"); return Asserts.error("没有该对象");
} else { } else {
TerminalScheduleRuleModel bean = new TerminalScheduleRuleModel(); TerminalScheduleRuleModel model = BeanUtil.copyProperties(bean, TerminalScheduleRuleModel.class);
bean.setId(item.getId()); return Asserts.success(model);
bean.setName(item.getName());
bean.setStartTime(item.getStartTime());
bean.setEndTime(item.getEndTime());
bean.setSpan(item.getSpan());
bean.setRemark(item.getRemark());
return Asserts.success(bean);
} }
} }
@ -106,22 +108,32 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return * @return
*/ */
@Override @Override
public ServiceBody<String> addSchedulelRuleList(TerminalRuleListVo vo) { @Transactional
ArrayList<TerminalScheduleRule> list = new ArrayList<>(); public ServiceBody<String> addSchedulelRuleList(ScheduleListVo vo) {
for (TerminalRuleVo item : vo.getList()) {
TerminalScheduleRule bean = new TerminalScheduleRule();
bean.setName(item.getName());
bean.setStartTime(item.getStartTime());
bean.setEndTime(item.getEndTime());
bean.setSpan(item.getSpan());
bean.setRemark(item.getRemark());
bean.setStatus(CommonStatus.EFFECTIVE.value());
list.add(bean);
}
Date date = new Date(); Date date = new Date();
int i = terminalScheduleRuleDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date); TerminalSchedule terminalSchedule = new TerminalSchedule();
if (i != 0) { terminalSchedule.setName(vo.getName());
return Asserts.success("录入成功"); terminalSchedule.setRemark(vo.getRemark());
terminalSchedule.setStatus(CommonStatus.EFFECTIVE.value());
terminalSchedule.setCreateTime(date);
terminalSchedule.setUpdateTime(date);
int i1 = terminalScheduleDao.insertSelective(terminalSchedule);
if (i1 != 0) {
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
rule.setScheduleId(terminalSchedule.getId());
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
} else { } else {
return Asserts.error("录入失败"); return Asserts.error("录入失败");
} }
@ -134,16 +146,33 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return * @return
*/ */
@Override @Override
public ServiceBody<String> updateSchelduleRule(TerminalRuleVo vo) { @Transactional
TerminalScheduleRule bean = new TerminalScheduleRule(); public ServiceBody<String> updateSchelduleRule(UpdateScheduleListVo vo) {
bean.setId(vo.getId()); Integer scheduleid = vo.getId();
bean.setName(vo.getName()); TerminalSchedule bean = terminalScheduleDao.selectByPrimaryKey(vo.getId());
bean.setStartTime(vo.getStartTime()); if (BeanUtil.isEmpty(bean)) {
bean.setEndTime(vo.getEndTime()); return Asserts.error("没有需要修改任务规则");
bean.setSpan(vo.getSpan()); }
bean.setRemark(vo.getRemark()); Date date = new Date();
bean.setStatus(CommonStatus.EFFECTIVE.value());
int i = terminalScheduleRuleDao.updateByPrimaryKeySelective(bean, new Date()); TerminalSchedule schedule = new TerminalSchedule();
schedule.setName(vo.getName());
schedule.setRemark(vo.getRemark());
schedule.setUpdateTime(date);
terminalScheduleDao.updateByPrimaryKeySelective(schedule);
terminalScheduleRuleDao.deleteById(scheduleid);
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
rule.setScheduleId(scheduleid);
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
if (i != 0) { if (i != 0) {
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} else { } else {
@ -159,9 +188,9 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return * @return
*/ */
@Override @Override
public ServiceBody<String> deleteSchelduleRule(TerminalRuleIdListVo vo) { public ServiceBody<String> deleteSchelduleRule(ScheduleIdListVo vo) {
List<TerminalScheduleRule> list = BeanUtil.copyToList(vo.getList(), TerminalScheduleRule.class); List<TerminalSchedule> list = BeanUtil.copyToList(vo.getList(), TerminalSchedule.class);
int i = terminalScheduleRuleDao.deleteById(list, CommonStatus.DELETE.value(), new Date()); int i = terminalScheduleDao.updateStatusById(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) { if (i != 0) {
return Asserts.success("删除成功"); return Asserts.success("删除成功");
} else { } else {
@ -181,7 +210,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
ArrayList<TerminalScheduleMapper> list = new ArrayList<>(); ArrayList<TerminalScheduleMapper> list = new ArrayList<>();
List<RelateTerminalListRuleIdVo.Item> termBeanList = vo.getList(); List<RelateTerminalListRuleIdVo.Item> termBeanList = vo.getList();
Integer ruleid = vo.getRuleid(); Integer scheduleid = vo.getScheduleid();
List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByTerminalBean(termBeanList); List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByTerminalBean(termBeanList);
boolean empty = CollectionUtil.isEmpty(mappers); boolean empty = CollectionUtil.isEmpty(mappers);
@ -192,7 +221,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
for (Integer id : item.getChannelidlist()) { for (Integer id : item.getChannelidlist()) {
TerminalScheduleMapper record = new TerminalScheduleMapper(); TerminalScheduleMapper record = new TerminalScheduleMapper();
record.setChannelId(id); record.setChannelId(id);
record.setScheduleId(ruleid); record.setScheduleId(scheduleid);
record.setTermId(item.getTermid()); record.setTermId(item.getTermid());
list.add(record); list.add(record);
} }
@ -208,6 +237,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
/** /**
* *
*
* @param vo * @param vo
* @return * @return
*/ */
@ -217,7 +247,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
TerminalScheduleMapper mapper = terminalScheduleMapperDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid()); TerminalScheduleMapper mapper = terminalScheduleMapperDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
if (mapper == null) { if (mapper == null) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
}else { } else {
Integer scheduleId = mapper.getScheduleId(); Integer scheduleId = mapper.getScheduleId();
TerminalScheduleRule bean = terminalScheduleRuleDao.selectByPrimaryKey(scheduleId); TerminalScheduleRule bean = terminalScheduleRuleDao.selectByPrimaryKey(scheduleId);
Time startTime = bean.getStartTime(); Time startTime = bean.getStartTime();

@ -3,10 +3,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.LineListModel; import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.DyLineTreeListModel; import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.vo.LineIdVo; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
/** /**
* 线 * 线
@ -44,4 +41,12 @@ public interface LineService {
* @return * @return
*/ */
ServiceBody<String> updateLine(UpdateLineVo vo); ServiceBody<String> updateLine(UpdateLineVo vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<String> getLineAndGt(LineAndGtAndChannelVo vo);
} }

@ -25,14 +25,14 @@ public interface TerminalScheduleRuleService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(TerminalRuleIdVo vo); ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(ScheduleIdVo vo);
/** /**
* *
* *
* @return * @return
*/ */
ServiceBody<String> addSchedulelRuleList(TerminalRuleListVo vo); ServiceBody<String> addSchedulelRuleList(ScheduleListVo vo);
/** /**
* *
@ -40,7 +40,7 @@ public interface TerminalScheduleRuleService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<String> updateSchelduleRule(TerminalRuleVo vo); ServiceBody<String> updateSchelduleRule(UpdateScheduleListVo vo);
/** /**
* *
@ -48,7 +48,7 @@ public interface TerminalScheduleRuleService {
* @param vo * @param vo
* @return * @return
*/ */
ServiceBody<String> deleteSchelduleRule(TerminalRuleIdListVo vo); ServiceBody<String> deleteSchelduleRule(ScheduleIdListVo vo);
/** /**
* *

Loading…
Cancel
Save