新增postgresql适配

This commit is contained in:
zhuyijun 2022-09-21 23:56:34 +08:00
parent ae81649732
commit 4d7590a3c9
7 changed files with 59 additions and 37 deletions

View File

@ -244,6 +244,7 @@
<!-- </dependency>-->
</dependencies>
</dependencyManagement>
<dependencies>

View File

@ -1,14 +0,0 @@
<?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="cn.zyjblogs.server.user.mapper.UserMapper">
<select id="findUserByname" resultType="cn.zyjblogs.server.user.po.UserPo">
select *
from user
where deleted = 0
and username like CONCAT('%', #{username}, '%')
<if test="tenantId != null and tenantId != '' ">
and tenant_id = #{tenantId}
</if>
</select>
</mapper>

View File

@ -33,28 +33,5 @@
</if>
order by create_time desc
</select>
<select id="findPage" resultType="cn.zyjblogs.server.user.vo.UserVo" databaseId="postgresql">
select * from users
where deleted = 0
<if test="userPageDto.username != null and userPageDto.username!='' ">
and username concat('%',#{userPageDto.username},'%')
</if>
<if test="userPageDto.name != null and userPageDto.name!='' ">
and name concat('%',#{name},'%')
</if>
<if test="userPageDto.phone != null and userPageDto.phone!='' ">
and phone concat('%',#{phone},'%')
</if>
<if test="userPageDto.email != null and userPageDto.email!='' ">
and email concat('%',#{email},'%')
</if>
<if test="userPageDto.email != null ">
and status = #{userPageDto.status}
</if>
<if test="tenantId != null and tenantId != '' ">
and tenant_id = #{tenantId}
</if>
order by create_time desc
</select>
</mapper>

View File

@ -0,0 +1,20 @@
<?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="cn.zyjblogs.server.role.mapper.RoleMapper">
<select id="findPage" resultType="cn.zyjblogs.server.role.vo.RoleVo">
select * from role
where deleted = 0
<if test="rolePageDto.username != null and rolePageDto.username!='' ">
and name concat('%',#{rolePageDto.name},'%')
</if>
<if test="rolePageDto.email != null ">
and status = #{rolePageDto.status}
</if>
<if test="tenantId != null and tenantId != '' ">
and tenant_id = #{tenantId}
</if>
order by create_time desc
</select>
</mapper>

View File

@ -0,0 +1,37 @@
<?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="cn.zyjblogs.server.user.mapper.UserMapper">
<select id="findUserByname" resultType="cn.zyjblogs.server.user.po.UserPo">
select *
from users
where deleted = 0
and username like CONCAT('%', #{username}, '%')
<if test="tenantId != null and tenantId != '' ">
and tenant_id = #{tenantId}
</if>
</select>
<select id="findPage" resultType="cn.zyjblogs.server.user.vo.UserVo">
select * from users
where deleted = 0
<if test="userPageDto.username != null and userPageDto.username!='' ">
and username concat('%',#{userPageDto.username},'%')
</if>
<if test="userPageDto.name != null and userPageDto.name!='' ">
and name concat('%',#{name},'%')
</if>
<if test="userPageDto.phone != null and userPageDto.phone!='' ">
and phone concat('%',#{phone},'%')
</if>
<if test="userPageDto.email != null and userPageDto.email!='' ">
and email concat('%',#{email},'%')
</if>
<if test="userPageDto.email != null ">
and status = #{userPageDto.status}
</if>
<if test="tenantId != null and tenantId != '' ">
and tenant_id = #{tenantId}
</if>
order by create_time desc
</select>
</mapper>

View File

@ -44,6 +44,7 @@
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>