Browse Source

数据库转换成pg,mapper修改sql语句

dev
mh 4 months ago
parent
commit
38136e4c5d
  1. 2
      mh-admin/src/main/resources/application.yml
  2. 2
      mh-admin/src/main/resources/banner.txt
  3. 8
      mh-generator/src/main/resources/mapper/generator/GenTableMapper.xml
  4. 4
      mh-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
  5. 4
      mh-system/src/main/resources/mapper/system/SysConfigMapper.xml
  6. 4
      mh-system/src/main/resources/mapper/system/SysDeptMapper.xml
  7. 4
      mh-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
  8. 4
      mh-system/src/main/resources/mapper/system/SysRoleMapper.xml
  9. 4
      mh-system/src/main/resources/mapper/system/SysUserMapper.xml

2
mh-admin/src/main/resources/application.yml

@ -3,7 +3,7 @@ mh:
# 名称
name: MH
# 版本
version: 3.8.8
version: 1.0.0
# 版权年份
copyrightYear: 2024
# 文件路径 示例( Windows配置D:/mh/uploadPath,Linux配置 /home/mh/uploadPath)

2
mh-admin/src/main/resources/banner.txt

@ -1,4 +1,4 @@
Application Version: ${ruoyi.version}
Application Version: ${mh.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //

8
mh-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@ -68,10 +68,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
AND to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
AND to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
</where>
</select>
@ -88,10 +88,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
AND to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
AND to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
order by create_time desc
</select>

4
mh-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml

@ -36,10 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND invoke_target like concat('%', #{invokeTarget}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
</where>
order by create_time desc

4
mh-system/src/main/resources/mapper/system/SysConfigMapper.xml

@ -51,10 +51,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND config_key like concat('%', #{configKey}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &lt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
</where>
</select>

4
mh-system/src/main/resources/mapper/system/SysDeptMapper.xml

@ -75,11 +75,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where #{deptId}::bigint = ANY(string_to_array(t.ancestors, ',')::int[])))
select * from sys_dept where #{deptId}::bigint = ANY(string_to_array(ancestors, ',')::int[])
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and #{deptId}::bigint = ANY(string_to_array(t.ancestors, ',')::int[])))
select count(*) from sys_dept where status = '0' and del_flag = '0' and #{deptId}::bigint = ANY(string_to_array(ancestors, ',')::int[])
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">

4
mh-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@ -33,10 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
and to_char(create_time, 'YYYYMMDD') &gt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
</where>
</select>

4
mh-system/src/main/resources/mapper/system/SysRoleMapper.xml

@ -46,10 +46,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND r.role_key like concat('%', #{roleKey}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(r.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
AND to_char(r.create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
AND to_char(u.create_time, 'YYYYMMDD') &gt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}

4
mh-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -73,10 +73,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
AND to_char(u.create_time, 'YYYYMMDD') &gt;= to_char(#{params.beginTime}::date, 'YYYYMMDD')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
AND to_char(u.create_time, 'YYYYMMDD') &lt;= to_char(#{params.endTime}::date, 'YYYYMMDD')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id

Loading…
Cancel
Save