refactor(online): 重命名 OnlineMb 中的 sql 属性为 sqlText

- 在 OnlineMb 类中,将 sql 属性重命名为 sqlText
- 更新了相关的 getter 和 setter 方法
- 修改了 mapper 文件中的对应字段
- 调整了 SQL 查询语句中的字段名称
This commit is contained in:
Dftre 2025-01-08 12:24:38 +08:00
parent bde0e974a0
commit 79bf3dfdf5
5 changed files with 22 additions and 24 deletions

View File

@ -134,7 +134,7 @@ public class OnLineController extends BaseController {
if (onlineMb.getUserId() != null && onlineMb.getUserId().equals("1")) {
object.put("userId", SecurityUtils.getUserId());
}
return processingMapper(onlineMb.getSql(), onlineMb.getActuator(), object);
return processingMapper(onlineMb.getSqlText(), onlineMb.getActuator(), object);
}
}

View File

@ -45,7 +45,7 @@ public class OnlineMb extends BaseEntity {
/** sql语句 */
@Schema(title = "sql语句")
@Excel(name = "sql语句")
private String sql;
private String sqlText;
/** 请求路径 */
@Schema(title = "请求路径")
@ -159,12 +159,12 @@ public class OnlineMb extends BaseEntity {
return resultMap;
}
public void setSql(String sql) {
this.sql = sql;
public void setSqlText(String sqlText) {
this.sqlText = sqlText;
}
public String getSql() {
return sql;
public String getSqlText() {
return sqlText;
}
public void setPath(String path) {
@ -207,7 +207,7 @@ public class OnlineMb extends BaseEntity {
.append("tagId", getTagId())
.append("parameterType", getParameterType())
.append("resultMap", getResultMap())
.append("sql", getSql())
.append("sqlText", getSqlText())
.append("path", getPath())
.append("method", getMethod())
.append("resultType", getResultType())

View File

@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tagId" column="tag_id" />
<result property="parameterType" column="parameter_type" />
<result property="resultMap" column="result_map" />
<result property="sql" column="sql" />
<result property="sqlText" column="sql_text" />
<result property="path" column="path" />
<result property="method" column="method" />
<result property="resultType" column="result_type" />
@ -22,19 +22,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOnlineMbVo">
select mb_id, tag, tag_id, parameter_type, result_map, `sql`, `path`, method, result_type, actuator,user_id,dept_id,permission_type,permission_value from online_mb
select mb_id, tag, tag_id, parameter_type, result_map, sql_text, online_mb.path, method, result_type, actuator,user_id,dept_id,permission_type,permission_value from online_mb
</sql>
<select id="selectOnlineMbList" parameterType="OnlineMb" resultMap="OnlineMbResult">
<include refid="selectOnlineMbVo"/>
<where>
online_mb.del_flag != 1
online_mb.del_flag != '1'
<if test="tag != null and tag != ''"> and tag = #{tag}</if>
<if test="tagId != null and tagId != ''"> and tag_id = #{tagId}</if>
<if test="parameterType != null and parameterType != ''"> and parameter_type = #{parameterType}</if>
<if test="resultMap != null and resultMap != ''"> and result_map = #{resultMap}</if>
<if test="sql != null and sql != ''"> and `sql` = #{sql}</if>
<if test="path != null and path != ''"> and `path` = #{path}</if>
<if test="sqlText != null and sqlText != ''"> and sql_text = #{sqlText}</if>
<if test="path != null and path != ''"> and path = #{path}</if>
<if test="method != null and method != ''"> and method = #{method}</if>
<if test="resultType != null and resultType != ''"> and result_type = #{resultType}</if>
<if test="actuator != null and actuator != ''"> and actuator = #{actuator}</if>
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOnlineMbByMbId" parameterType="Long" resultMap="OnlineMbResult">
<include refid="selectOnlineMbVo"/>
where online_mb.mb_id = #{mbId} and online_mb.del_flag != 1
where online_mb.mb_id = #{mbId} and online_mb.del_flag != '1'
</select>
<insert id="insertOnlineMb" parameterType="OnlineMb">
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tagId != null">tag_id,</if>
<if test="parameterType != null">parameter_type,</if>
<if test="resultMap != null">result_map,</if>
<if test="sql != null">`sql`,</if>
<if test="sqlText != null">sql_text,</if>
<if test="path != null and path != ''">path,</if>
<if test="method != null and method != ''">method,</if>
<if test="resultType != null">result_type,</if>
@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tagId != null">#{tagId},</if>
<if test="parameterType != null">#{parameterType},</if>
<if test="resultMap != null">#{resultMap},</if>
<if test="sql != null">#{sql},</if>
<if test="sqlText != null">#{sqlText},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="method != null and method != ''">#{method},</if>
<if test="resultType != null">#{resultType},</if>
@ -93,8 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tagId != null">tag_id = #{tagId},</if>
<if test="parameterType != null">parameter_type = #{parameterType},</if>
<if test="resultMap != null">result_map = #{result_map},</if>
<if test="sql != null">`sql` = #{sql},</if>
<if test="path != null and path != ''">`path` = #{path},</if>
<if test="sqlText != null">sql_text = #{sqlText},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="method != null and method != ''">method = #{method},</if>
<if test="resultType != null">result_type = #{resultType},</if>
<if test="actuator != null and actuator != ''">actuator = #{actuator},</if>
@ -103,15 +103,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="permissionType != null and permissionType != ''">permission_type = #{permissionType},</if>
<if test="permissionValue != null and permissionValue != ''">permission_value = #{permissionValue},</if>
</trim>
where online_mb.mb_id = #{mbId} and online_mb.del_flag != 1
where online_mb.mb_id = #{mbId} and online_mb.del_flag != '1'
</update>
<delete id="deleteOnlineMbByMbId" parameterType="Long">
update online_mb set del_flag = 1 where mb_id = #{mbId}
update online_mb set del_flag = '1' where mb_id = #{mbId}
</delete>
<delete id="deleteOnlineMbByMbIds" parameterType="String">
update online_mb set del_flag = 1 where mb_id in
update online_mb set del_flag = '1' where mb_id in
<foreach item="mbId" collection="array" open="(" separator="," close=")">
#{mbId}
</foreach>

View File

@ -1,3 +1 @@
CREATE DATABASE IF NOT EXISTS ry
CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;
CREATE DATABASE IF NOT EXISTS ry CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

View File

@ -6,7 +6,7 @@ CREATE TABLE online_mb (
tag_id varchar(255) NULL COMMENT '标签id',
parameter_type varchar(255) NULL COMMENT '参数类型',
result_map varchar(255) NULL COMMENT '结果类型',
`sql` varchar(255) NULL COMMENT 'sql语句',
sql_text varchar(255) NULL COMMENT 'sql语句',
path varchar(255) NULL COMMENT '请求路径',
method varchar(255) NULL COMMENT '请求方式',
result_type varchar(255) NULL COMMENT '响应类型',