feat: 解决mybatis-flex和mybatis sql 冲突问题

This commit is contained in:
landaiqing
2024-06-02 03:05:05 +08:00
parent b15a929bb9
commit bb74574bc3
13 changed files with 13 additions and 161 deletions

View File

@@ -43,14 +43,6 @@ public interface SchisandraAuthPermissionDao extends BaseMapper<SchisandraAuthPe
*/
long count(SchisandraAuthPermission schisandraAuthPermission);
/**
* 新增数据
*
* @param schisandraAuthPermission 实例对象
* @return 影响行数
*/
int insert(SchisandraAuthPermission schisandraAuthPermission);
/**
* 批量新增数据MyBatis原生foreach方法
*
@@ -68,21 +60,7 @@ public interface SchisandraAuthPermissionDao extends BaseMapper<SchisandraAuthPe
*/
int insertOrUpdateBatch(@Param("entities") List<SchisandraAuthPermission> entities);
/**
* 修改数据
*
* @param schisandraAuthPermission 实例对象
* @return 影响行数
*/
int update(SchisandraAuthPermission schisandraAuthPermission);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Long id);
}

View File

@@ -43,13 +43,6 @@ public interface SchisandraAuthRoleDao extends BaseMapper<SchisandraAuthRole> {
*/
long count(SchisandraAuthRole schisandraAuthRole);
/**
* 新增数据
*
* @param schisandraAuthRole 实例对象
* @return 影响行数
*/
int insert(SchisandraAuthRole schisandraAuthRole);
/**
* 批量新增数据MyBatis原生foreach方法
@@ -68,21 +61,8 @@ public interface SchisandraAuthRoleDao extends BaseMapper<SchisandraAuthRole> {
*/
int insertOrUpdateBatch(@Param("entities") List<SchisandraAuthRole> entities);
/**
* 修改数据
*
* @param schisandraAuthRole 实例对象
* @return 影响行数
*/
int update(SchisandraAuthRole schisandraAuthRole);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Long id);
}

View File

@@ -64,7 +64,7 @@ public class SchisandraAuthRolePermission implements Serializable {
/**
*
*/
@Column("is_deleted")
@Column(value = "is_deleted",isLogicDelete = true)
private Integer isDeleted;
}

View File

@@ -1,12 +1,12 @@
package com.schisandra.auth.infra.basic.service.impl;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthPermission;
import com.schisandra.auth.infra.basic.dao.SchisandraAuthPermissionDao;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthPermission;
import com.schisandra.auth.infra.basic.service.SchisandraAuthPermissionService;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

View File

@@ -128,11 +128,6 @@
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into schisandra_auth_permission(`name`,parent_id,`type`,menu_url,`status`,`show`,icon,permission_key,created_by,created_time,update_by,update_time,is_deleted)
values (#{name},#{parentId},#{type},#{menuUrl},#{status},#{show},#{icon},#{permissionKey},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
@@ -157,59 +152,6 @@
values(update_time)is_deleted = values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update schisandra_auth_permission
<set>
<if test="name != null and name != ''">
`name` = #{name},
</if>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="type != null">
`type` = #{type},
</if>
<if test="menuUrl != null and menuUrl != ''">
menu_url = #{menuUrl},
</if>
<if test="status != null">
`status` = #{status},
</if>
<if test="show != null">
`show` = #{show},
</if>
<if test="icon != null and icon != ''">
icon = #{icon},
</if>
<if test="permissionKey != null and permissionKey != ''">
permission_key = #{permissionKey},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from schisandra_auth_permission
where id = #{id}
</delete>
</mapper>

View File

@@ -86,11 +86,6 @@
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into schisandra_auth_role(role_name,role_key,created_by,created_time,update_by,update_time,is_deleted)
values (#{roleName},#{roleKey},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into schisandra_auth_role(role_name,role_key,created_by,created_time,update_by,update_time,is_deleted)
@@ -112,41 +107,6 @@
values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update schisandra_auth_role
<set>
<if test="roleName != null and roleName != ''">
role_name = #{roleName},
</if>
<if test="roleKey != null and roleKey != ''">
role_key = #{roleKey},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from schisandra_auth_role
where id = #{id}
</delete>
</mapper>

View File

@@ -89,7 +89,7 @@ mybatis-flex:
deleted-value-of-logic-delete: 1
logic-delete-column: is_deleted
mapper-locations:
- "classpath*:/mapper/**/*.xml"
- "classpath*:/mapper/*.xml"
# 前端地址
web:

View File

@@ -1,8 +1,6 @@
spring:
application:
name: schisandra-cloud-storage-auth-dev
profiles:
active: dev
name: schisandra-cloud-storage-auth
cloud:
nacos:
config: