From c6fc7635ed53e7281269c00f82a33c150a91d4be Mon Sep 17 00:00:00 2001 From: huangfeng Date: Tue, 10 Sep 2024 14:28:33 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20mntn=5Fcmd=5Fhistory=E5=92=8Cmntn=5Fcmd?= =?UTF-8?q?=5Fresults=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MntnController.java | 2 +- .../entity/MntnCmdHistory.java | 105 ++++++++++- .../entity/MntnCmdHistoryExample.java | 140 +++++++++++++-- .../dao/MntnCmdHistoryMapper.java | 24 +++ .../mappers/MntnCmdHistoryMapper.xml | 164 +++++++++++++++--- .../impl/CmdServiceImpl.java | 10 +- .../impl/MntnServiceImpl.java | 19 +- .../service/MntnService.java | 2 +- 8 files changed, 414 insertions(+), 52 deletions(-) diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/MntnController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/MntnController.java index fddea6c..ff03f58 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/MntnController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/MntnController.java @@ -66,7 +66,7 @@ public class MntnController extends BaseController { @GetMapping("status") @ApiOperation("上传命令结果") - public ResponseReult status(@RequestParam("cid") Integer cid, + public ResponseReult status(@RequestParam("cid") Long cid, @RequestParam("res") Integer res, @RequestParam("content") String content) { service.result(cid, res, content); diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistory.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistory.java index 9c54835..d028d8d 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistory.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistory.java @@ -56,7 +56,7 @@ public class MntnCmdHistory { * * @mbg.generated */ - private Byte status; + private Integer status; /** * @@ -76,6 +76,33 @@ public class MntnCmdHistory { */ private Date publishTime; + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column mntn_cmd_history.result + * + * @mbg.generated + */ + private Integer result; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column mntn_cmd_history.res_time + * + * @mbg.generated + */ + private Date resTime; + + /** + * + * This field was generated by MyBatis Generator. + * This field corresponds to the database column mntn_cmd_history.content + * + * @mbg.generated + */ + private String content; + /** * This method was generated by MyBatis Generator. * This method returns the value of the database column mntn_cmd_history.id @@ -204,7 +231,7 @@ public class MntnCmdHistory { * * @mbg.generated */ - public Byte getStatus() { + public Integer getStatus() { return status; } @@ -216,7 +243,7 @@ public class MntnCmdHistory { * * @mbg.generated */ - public void setStatus(Byte status) { + public void setStatus(Integer status) { this.status = status; } @@ -268,6 +295,78 @@ public class MntnCmdHistory { this.publishTime = publishTime; } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column mntn_cmd_history.result + * + * @return the value of mntn_cmd_history.result + * + * @mbg.generated + */ + public Integer getResult() { + return result; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column mntn_cmd_history.result + * + * @param result the value for mntn_cmd_history.result + * + * @mbg.generated + */ + public void setResult(Integer result) { + this.result = result; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column mntn_cmd_history.res_time + * + * @return the value of mntn_cmd_history.res_time + * + * @mbg.generated + */ + public Date getResTime() { + return resTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column mntn_cmd_history.res_time + * + * @param resTime the value for mntn_cmd_history.res_time + * + * @mbg.generated + */ + public void setResTime(Date resTime) { + this.resTime = resTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column mntn_cmd_history.content + * + * @return the value of mntn_cmd_history.content + * + * @mbg.generated + */ + public String getContent() { + return content; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column mntn_cmd_history.content + * + * @param content the value for mntn_cmd_history.content + * + * @mbg.generated + */ + public void setContent(String content) { + this.content = content; + } + private Terminals terminal; public Terminals getTerminal() { diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistoryExample.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistoryExample.java index 2a434f0..575fc41 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistoryExample.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/MntnCmdHistoryExample.java @@ -535,52 +535,52 @@ public class MntnCmdHistoryExample { return (Criteria) this; } - public Criteria andStatusEqualTo(Byte value) { + public Criteria andStatusEqualTo(Integer value) { addCriterion("`status` =", value, "status"); return (Criteria) this; } - public Criteria andStatusNotEqualTo(Byte value) { + public Criteria andStatusNotEqualTo(Integer value) { addCriterion("`status` <>", value, "status"); return (Criteria) this; } - public Criteria andStatusGreaterThan(Byte value) { + public Criteria andStatusGreaterThan(Integer value) { addCriterion("`status` >", value, "status"); return (Criteria) this; } - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { addCriterion("`status` >=", value, "status"); return (Criteria) this; } - public Criteria andStatusLessThan(Byte value) { + public Criteria andStatusLessThan(Integer value) { addCriterion("`status` <", value, "status"); return (Criteria) this; } - public Criteria andStatusLessThanOrEqualTo(Byte value) { + public Criteria andStatusLessThanOrEqualTo(Integer value) { addCriterion("`status` <=", value, "status"); return (Criteria) this; } - public Criteria andStatusIn(List values) { + public Criteria andStatusIn(List values) { addCriterion("`status` in", values, "status"); return (Criteria) this; } - public Criteria andStatusNotIn(List values) { + public Criteria andStatusNotIn(List values) { addCriterion("`status` not in", values, "status"); return (Criteria) this; } - public Criteria andStatusBetween(Byte value1, Byte value2) { + public Criteria andStatusBetween(Integer value1, Integer value2) { addCriterion("`status` between", value1, value2, "status"); return (Criteria) this; } - public Criteria andStatusNotBetween(Byte value1, Byte value2) { + public Criteria andStatusNotBetween(Integer value1, Integer value2) { addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } @@ -704,6 +704,126 @@ public class MntnCmdHistoryExample { addCriterion("publish_time not between", value1, value2, "publishTime"); return (Criteria) this; } + + public Criteria andResultIsNull() { + addCriterion("`result` is null"); + return (Criteria) this; + } + + public Criteria andResultIsNotNull() { + addCriterion("`result` is not null"); + return (Criteria) this; + } + + public Criteria andResultEqualTo(Integer value) { + addCriterion("`result` =", value, "result"); + return (Criteria) this; + } + + public Criteria andResultNotEqualTo(Integer value) { + addCriterion("`result` <>", value, "result"); + return (Criteria) this; + } + + public Criteria andResultGreaterThan(Integer value) { + addCriterion("`result` >", value, "result"); + return (Criteria) this; + } + + public Criteria andResultGreaterThanOrEqualTo(Integer value) { + addCriterion("`result` >=", value, "result"); + return (Criteria) this; + } + + public Criteria andResultLessThan(Integer value) { + addCriterion("`result` <", value, "result"); + return (Criteria) this; + } + + public Criteria andResultLessThanOrEqualTo(Integer value) { + addCriterion("`result` <=", value, "result"); + return (Criteria) this; + } + + public Criteria andResultIn(List values) { + addCriterion("`result` in", values, "result"); + return (Criteria) this; + } + + public Criteria andResultNotIn(List values) { + addCriterion("`result` not in", values, "result"); + return (Criteria) this; + } + + public Criteria andResultBetween(Integer value1, Integer value2) { + addCriterion("`result` between", value1, value2, "result"); + return (Criteria) this; + } + + public Criteria andResultNotBetween(Integer value1, Integer value2) { + addCriterion("`result` not between", value1, value2, "result"); + return (Criteria) this; + } + + public Criteria andResTimeIsNull() { + addCriterion("res_time is null"); + return (Criteria) this; + } + + public Criteria andResTimeIsNotNull() { + addCriterion("res_time is not null"); + return (Criteria) this; + } + + public Criteria andResTimeEqualTo(Date value) { + addCriterion("res_time =", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeNotEqualTo(Date value) { + addCriterion("res_time <>", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeGreaterThan(Date value) { + addCriterion("res_time >", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeGreaterThanOrEqualTo(Date value) { + addCriterion("res_time >=", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeLessThan(Date value) { + addCriterion("res_time <", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeLessThanOrEqualTo(Date value) { + addCriterion("res_time <=", value, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeIn(List values) { + addCriterion("res_time in", values, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeNotIn(List values) { + addCriterion("res_time not in", values, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeBetween(Date value1, Date value2) { + addCriterion("res_time between", value1, value2, "resTime"); + return (Criteria) this; + } + + public Criteria andResTimeNotBetween(Date value1, Date value2) { + addCriterion("res_time not between", value1, value2, "resTime"); + return (Criteria) this; + } } /** diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/MntnCmdHistoryMapper.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/MntnCmdHistoryMapper.java index e42bb95..ee122e7 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/MntnCmdHistoryMapper.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/MntnCmdHistoryMapper.java @@ -47,6 +47,14 @@ public interface MntnCmdHistoryMapper { */ int insertSelective(MntnCmdHistory row); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table mntn_cmd_history + * + * @mbg.generated + */ + List selectByExampleWithBLOBs(MntnCmdHistoryExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table mntn_cmd_history @@ -71,6 +79,14 @@ public interface MntnCmdHistoryMapper { */ int updateByExampleSelective(@Param("row") MntnCmdHistory row, @Param("example") MntnCmdHistoryExample example); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table mntn_cmd_history + * + * @mbg.generated + */ + int updateByExampleWithBLOBs(@Param("row") MntnCmdHistory row, @Param("example") MntnCmdHistoryExample example); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table mntn_cmd_history @@ -87,6 +103,14 @@ public interface MntnCmdHistoryMapper { */ int updateByPrimaryKeySelective(MntnCmdHistory row); + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table mntn_cmd_history + * + * @mbg.generated + */ + int updateByPrimaryKeyWithBLOBs(MntnCmdHistory row); + /** * This method was generated by MyBatis Generator. * This method corresponds to the database table mntn_cmd_history diff --git a/xymanager_dao/src/main/resources/mappers/MntnCmdHistoryMapper.xml b/xymanager_dao/src/main/resources/mappers/MntnCmdHistoryMapper.xml index 2fb5d01..710659b 100644 --- a/xymanager_dao/src/main/resources/mappers/MntnCmdHistoryMapper.xml +++ b/xymanager_dao/src/main/resources/mappers/MntnCmdHistoryMapper.xml @@ -11,9 +11,18 @@ - + + + + + + + - id, term_id, `name`, cmd, `desc`, `status`, create_time, publish_time + id, term_id, `name`, cmd, `desc`, `status`, create_time, publish_time, `result`, + res_time + + + content + + @@ -139,23 +178,28 @@ WARNING - @mbg.generated This element is automatically generated by MyBatis Generator, do not modify. --> - insert into mntn_cmd_history (id, term_id, `name`, - cmd, `desc`, `status`, - create_time, publish_time) - values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, - #{cmd,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{createTime,jdbcType=TIMESTAMP}, #{publishTime,jdbcType=TIMESTAMP}) + + SELECT LAST_INSERT_ID() + + insert into mntn_cmd_history (term_id, `name`, cmd, + `desc`, `status`, create_time, + publish_time, `result`, res_time, + content) + values (#{termId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{cmd,jdbcType=VARCHAR}, + #{desc,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, + #{publishTime,jdbcType=TIMESTAMP}, #{result,jdbcType=INTEGER}, #{resTime,jdbcType=TIMESTAMP}, + #{content,jdbcType=LONGVARCHAR}) + + SELECT LAST_INSERT_ID() + insert into mntn_cmd_history - - id, - term_id, @@ -177,11 +221,17 @@ publish_time, + + `result`, + + + res_time, + + + content, + - - #{id,jdbcType=BIGINT}, - #{termId,jdbcType=INTEGER}, @@ -195,7 +245,7 @@ #{desc,jdbcType=VARCHAR}, - #{status,jdbcType=TINYINT}, + #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, @@ -203,6 +253,15 @@ #{publishTime,jdbcType=TIMESTAMP}, + + #{result,jdbcType=INTEGER}, + + + #{resTime,jdbcType=TIMESTAMP}, + + + #{content,jdbcType=LONGVARCHAR}, +