feat: 系统配置连表查询完成

This commit is contained in:
bunny 2024-10-31 09:21:55 +08:00
parent bdff8f7906
commit bc863932a9
14 changed files with 60 additions and 66 deletions

View File

@ -1,6 +1,6 @@
package cn.bunny.dao.vo.system;
import cn.bunny.dao.common.vo.BaseVo;
import cn.bunny.dao.common.vo.BaseUserVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -10,7 +10,7 @@ import lombok.*;
@NoArgsConstructor
@Builder
@Schema(name = "MenuIconVo对象", title = "系统菜单图标", description = "系统菜单图标")
public class MenuIconVo extends BaseVo {
public class MenuIconVo extends BaseUserVo {
@Schema(name = "iconCode", title = "icon类名")
private String iconCode;

View File

@ -1,6 +1,6 @@
package cn.bunny.dao.vo.system.email;
import cn.bunny.dao.common.vo.BaseVo;
import cn.bunny.dao.common.vo.BaseUserVo;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ -13,7 +13,7 @@ import lombok.*;
@NoArgsConstructor
@Builder
@Schema(name = "EmailTemplateVo对象", title = "邮箱模板返回内容", description = "邮箱模板返回内容")
public class EmailTemplateVo extends BaseVo {
public class EmailTemplateVo extends BaseUserVo {
@Schema(name = "templateName", title = "模板名称")
private String templateName;

View File

@ -1,6 +1,6 @@
package cn.bunny.dao.vo.system.email;
import cn.bunny.dao.common.vo.BaseVo;
import cn.bunny.dao.common.vo.BaseUserVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -10,7 +10,7 @@ import lombok.*;
@NoArgsConstructor
@Builder
@Schema(name = "EmailUsersVo对象", title = "邮箱用户发送配置", description = "邮箱用户发送配置管理")
public class EmailUsersVo extends BaseVo {
public class EmailUsersVo extends BaseUserVo {
@Schema(name = "email", title = "邮箱")
private String email;

View File

@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
import cn.bunny.dao.entity.system.EmailTemplate;
import cn.bunny.dao.vo.system.email.EmailTemplateVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -28,7 +29,7 @@ public interface EmailTemplateMapper extends BaseMapper<EmailTemplate> {
* @param dto 邮件模板表查询表单
* @return 邮件模板表分页结果
*/
IPage<EmailTemplate> selectListByPage(@Param("page") Page<EmailTemplate> pageParams, @Param("dto") EmailTemplateDto dto);
IPage<EmailTemplateVo> selectListByPage(@Param("page") Page<EmailTemplate> pageParams, @Param("dto") EmailTemplateDto dto);
/**
* 物理删除邮件模板表

View File

@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
import cn.bunny.dao.entity.system.EmailUsers;
import cn.bunny.dao.vo.system.email.EmailUsersVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -28,7 +29,7 @@ public interface EmailUsersMapper extends BaseMapper<EmailUsers> {
* @param dto 邮箱用户发送配置查询表单
* @return 邮箱用户发送配置分页结果
*/
IPage<EmailUsers> selectListByPage(@Param("page") Page<EmailUsers> pageParams, @Param("dto") EmailUsersDto dto);
IPage<EmailUsersVo> selectListByPage(@Param("page") Page<EmailUsers> pageParams, @Param("dto") EmailUsersDto dto);
/**
* 物理删除邮箱用户发送配置

View File

@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
import cn.bunny.dao.dto.system.menuIcon.MenuIconDto;
import cn.bunny.dao.entity.system.MenuIcon;
import cn.bunny.dao.vo.system.MenuIconVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -28,7 +29,7 @@ public interface MenuIconMapper extends BaseMapper<MenuIcon> {
* @param dto 系统菜单图标查询表单
* @return 系统菜单图标分页结果
*/
IPage<MenuIcon> selectListByPage(@Param("page") Page<MenuIcon> pageParams, @Param("dto") MenuIconDto dto);
IPage<MenuIconVo> selectListByPage(@Param("page") Page<MenuIcon> pageParams, @Param("dto") MenuIconDto dto);
/**
* 物理删除系统菜单图标

View File

@ -45,16 +45,10 @@ public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, E
@Override
public PageResult<EmailTemplateVo> getEmailTemplateList(Page<EmailTemplate> pageParams, EmailTemplateDto dto) {
// 分页查询菜单图标
IPage<EmailTemplate> page = baseMapper.selectListByPage(pageParams, dto);
List<EmailTemplateVo> voList = page.getRecords().stream().map(emailTemplate -> {
EmailTemplateVo emailTemplateVo = new EmailTemplateVo();
BeanUtils.copyProperties(emailTemplate, emailTemplateVo);
return emailTemplateVo;
}).toList();
IPage<EmailTemplateVo> page = baseMapper.selectListByPage(pageParams, dto);
return PageResult.<EmailTemplateVo>builder()
.list(voList)
.list(page.getRecords())
.pageNo(page.getCurrent())
.pageSize(page.getSize())
.total(page.getTotal())

View File

@ -50,16 +50,10 @@ public class EmailUsersServiceImpl extends ServiceImpl<EmailUsersMapper, EmailUs
@Override
public PageResult<EmailUsersVo> getEmailUsersList(Page<EmailUsers> pageParams, EmailUsersDto dto) {
// 分页查询菜单图标
IPage<EmailUsers> page = baseMapper.selectListByPage(pageParams, dto);
List<EmailUsersVo> voList = page.getRecords().stream().map(emailUsers -> {
EmailUsersVo emailUsersVo = new EmailUsersVo();
BeanUtils.copyProperties(emailUsers, emailUsersVo);
return emailUsersVo;
}).toList();
IPage<EmailUsersVo> page = baseMapper.selectListByPage(pageParams, dto);
return PageResult.<EmailUsersVo>builder()
.list(voList)
.list(page.getRecords())
.pageNo(page.getCurrent())
.pageSize(page.getSize())
.total(page.getTotal())

View File

@ -46,16 +46,9 @@ public class MenuIconServiceImpl extends ServiceImpl<MenuIconMapper, MenuIcon> i
@Override
public PageResult<MenuIconVo> getMenuIconList(Page<MenuIcon> pageParams, MenuIconDto dto) {
// 分页查询菜单图标
IPage<MenuIcon> page = baseMapper.selectListByPage(pageParams, dto);
List<MenuIconVo> voList = page.getRecords().stream().map(MenuIcon -> {
MenuIconVo MenuIconVo = new MenuIconVo();
BeanUtils.copyProperties(MenuIcon, MenuIconVo);
return MenuIconVo;
}).toList();
IPage<MenuIconVo> page = baseMapper.selectListByPage(pageParams, dto);
return PageResult.<MenuIconVo>builder()
.list(voList)
.list(page.getRecords())
.pageNo(page.getCurrent())
.pageSize(page.getSize())
.total(page.getTotal())

View File

@ -24,23 +24,27 @@
</sql>
<!-- 分页查询邮件模板表内容 -->
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.EmailTemplate">
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.email.EmailTemplateVo">
select
<include refid="Base_Column_List"/>
from sys_email_template
template.*,
create_user.username as create_username,
update_user.username as update_username
from sys_email_template template
left join sys_user create_user on create_user.id = template.create_user
left join sys_user update_user on update_user.id = template.update_user
<where>
is_deleted = 0
template.is_deleted = 0
<if test="dto.templateName != null and dto.templateName != ''">
and template_name like CONCAT('%',#{dto.templateName},'%')
and template.template_name like CONCAT('%',#{dto.templateName},'%')
</if>
<if test="dto.subject != null and dto.subject != ''">
and subject like CONCAT('%',#{dto.subject},'%')
and template.subject like CONCAT('%',#{dto.subject},'%')
</if>
<if test="dto.body != null and dto.body != ''">
and body like CONCAT('%',#{dto.body},'%')
and template.body like CONCAT('%',#{dto.body},'%')
</if>
<if test="dto.type != null and dto.type != ''">
and type like CONCAT('%',#{dto.type},'%')
and template.type like CONCAT('%',#{dto.type},'%')
</if>
</where>
</select>

View File

@ -24,26 +24,29 @@
</sql>
<!-- 分页查询邮箱用户发送配置内容 -->
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.EmailUsers">
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.email.EmailUsersVo">
select
<include refid="Base_Column_List"/>
from sys_email_users
email_user.*,
create_user.username as create_username,
update_user.username as update_username
from sys_email_users email_user
left join sys_user create_user on create_user.id = email_user.create_user
left join sys_user update_user on update_user.id = email_user.update_user
<where>
is_deleted = 0
email_user.is_deleted = 0
<if test="dto.email != null and dto.email != ''">
and email like CONCAT('%',#{dto.email},'%')
and email_user.email like CONCAT('%',#{dto.email},'%')
</if>
<if test="dto.host != null and dto.host != ''">
and host like CONCAT('%',#{dto.host},'%')
and email_user.host like CONCAT('%',#{dto.host},'%')
</if>
<if test="dto.port != null and dto.port != ''">
and port like CONCAT('%',#{dto.port},'%')
and email_user.port like CONCAT('%',#{dto.port},'%')
</if>
<if test="dto.smtpAgreement != null and dto.smtpAgreement != ''">
and smtp_agreement like CONCAT('%',#{dto.smtpAgreement},'%')
and email_user.smtp_agreement like CONCAT('%',#{dto.smtpAgreement},'%')
</if>
</where>
order by create_time desc
</select>
<!-- 物理删除邮箱用户发送配置 -->

View File

@ -20,20 +20,23 @@
</sql>
<!-- 分页查询系统菜单图标内容 -->
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.MenuIcon">
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.MenuIconVo">
select
<include refid="Base_Column_List"/>
from sys_menu_icon
icon.*,
create_user.username as create_username,
update_user.username as update_username
from sys_menu_icon icon
left join sys_user create_user on create_user.id = icon.create_user
left join sys_user update_user on update_user.id = icon.update_user
<where>
is_deleted = 0
icon.is_deleted = 0
<if test="dto.iconCode != null and dto.iconCode != ''">
and icon_code like CONCAT('%',#{dto.iconCode},'%')
and icon.icon_code like CONCAT('%',#{dto.iconCode},'%')
</if>
<if test="dto.iconName != null and dto.iconName != ''">
and icon_name like CONCAT('%',#{dto.iconName},'%')
and icon.icon_name like CONCAT('%',#{dto.iconName},'%')
</if>
</where>
order by update_time desc
</select>
<!-- 物理删除系统菜单图标 -->

View File

@ -33,7 +33,7 @@
<where>
power.is_deleted = 0
<if test="dto.powerCode != null and dto.powerCode != ''">
and ppower.ower_code like CONCAT('%',#{dto.powerCode},'%')
and power.power_code like CONCAT('%',#{dto.powerCode},'%')
</if>
<if test="dto.powerName != null and dto.powerName != ''">
and power.power_name like CONCAT('%',#{dto.powerName},'%')

View File

@ -42,25 +42,25 @@
<where>
user.is_deleted = 0
<if test="dto.username != null and dto.username != ''">
and username like CONCAT('%',#{dto.username},'%')
and user.username like CONCAT('%',#{dto.username},'%')
</if>
<if test="dto.nickname != null and dto.nickname != ''">
and nickname like CONCAT('%',#{dto.nickname},'%')
and user.nickname like CONCAT('%',#{dto.nickname},'%')
</if>
<if test="dto.email != null and dto.email != ''">
and email like CONCAT('%',#{dto.email},'%')
and user.email like CONCAT('%',#{dto.email},'%')
</if>
<if test="dto.phone != null and dto.phone != ''">
and phone like CONCAT('%',#{dto.phone},'%')
and user.phone like CONCAT('%',#{dto.phone},'%')
</if>
<if test="dto.sex != null and dto.sex != ''">
and sex = #{dto.sex}
and user.sex = #{dto.sex}
</if>
<if test="dto.summary != null and dto.summary != ''">
and summary like CONCAT('%',#{dto.summary},'%')
and user.summary like CONCAT('%',#{dto.summary},'%')
</if>
<if test="dto.status != null and dto.status != ''">
and status = #{dto.status}
and user.status = #{dto.status}
</if>
<if test="dto.deptIds != null and dto.deptIds.size() > 0">
and user_dept.dept_id in