Compare commits

..

No commits in common. 'master' and 'develop' have entirely different histories.

@ -8,4 +8,9 @@
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="SwUserDefinedSpecifications">
<option name="specTypeByUrl">
<map />
</option>
</component>
</project> </project>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
</project> </project>

@ -1,54 +1,21 @@
package com; package com;
// 导入 MyBatis-Spring 框架提供的注解,用于扫描指定包下的 Mapper 接口
// 扫描后 Spring 会自动为这些接口创建代理对象,从而实现数据库操作
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
// 导入 Spring Boot 应用启动相关的类,该类可用于启动 Spring Boot 应用
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
// 导入 Spring Boot 自动配置注解,启用 Spring Boot 的自动配置功能
// 它会根据项目依赖自动配置 Spring 应用的各种组件
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
// 导入 Spring Boot 应用构建器类,用于构建 Spring Boot 应用实例
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
// 导入 Spring Boot 支持 Servlet 容器部署的初始化器类
// 继承该类可使 Spring Boot 应用以 WAR 包形式部署到外部 Servlet 容器
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* Spring Boot
* Spring Boot MyBatis Mapper
* WAR Servlet
*/
@SpringBootApplication @SpringBootApplication
// 此注解用于指定 MyBatis 要扫描的 Mapper 接口所在的包路径
// 这里指定扫描 "com.dao" 包Spring 会为该包下的 Mapper 接口生成代理实现
@MapperScan(basePackages = {"com.dao"}) @MapperScan(basePackages = {"com.dao"})
public class SpringbootSchemaApplication extends SpringBootServletInitializer { public class SpringbootSchemaApplication extends SpringBootServletInitializer{
/**
* Java
* Spring Boot
* SpringApplication.run Spring Boot
*
* @param args
*/
public static void main(String[] args) { public static void main(String[] args) {
// 调用 SpringApplication 的 run 方法来启动 Spring Boot 应用
// 传入当前类的 Class 对象和命令行参数
SpringApplication.run(SpringbootSchemaApplication.class, args); SpringApplication.run(SpringbootSchemaApplication.class, args);
} }
/**
* SpringBootServletInitializer configure
* Spring Boot Servlet
* WAR Servlet Tomcat
*
* @param applicationBuilder SpringApplicationBuilder Spring Boot
* @return SpringApplicationBuilder
*/
@Override @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
// 设置 Spring Boot 应用的主类为当前类,确保在外部 Servlet 容器中正确启动 return applicationBuilder.sources(SpringbootSchemaApplication.class);
return applicationBuilder.sources(SpringbootSchemaApplication.class); }
} }
}

@ -1,35 +1,22 @@
package com.service; // 声明该类所属的包为com.service package com.service;
// 导入List接口用于表示有序的集合
import java.util.List; import java.util.List;
// 导入Map接口用于表示键值对的集合
import java.util.Map; import java.util.Map;
/**
*
*/
public interface CommonService { public interface CommonService {
// 根据传入的参数Map查询选项列表返回一个包含字符串的列表
List<String> getOption(Map<String, Object> params); List<String> getOption(Map<String, Object> params);
// 根据传入的参数Map查询关联信息返回一个包含键值对的Map
Map<String, Object> getFollowByOption(Map<String, Object> params); Map<String, Object> getFollowByOption(Map<String, Object> params);
// 根据传入的参数Map执行更新操作没有返回值
void sh(Map<String, Object> params); void sh(Map<String, Object> params);
// 根据传入的参数Map统计提醒数量返回一个整数
int remindCount(Map<String, Object> params); int remindCount(Map<String, Object> params);
// 根据传入的参数Map进行统计计算返回一个包含统计结果的Map
Map<String, Object> selectCal(Map<String, Object> params); Map<String, Object> selectCal(Map<String, Object> params);
// 根据传入的参数Map进行分组查询返回一个包含多个键值对Map的列表
List<Map<String, Object>> selectGroup(Map<String, Object> params); List<Map<String, Object>> selectGroup(Map<String, Object> params);
// 根据传入的参数Map查询值列表返回一个包含多个键值对Map的列表
List<Map<String, Object>> selectValue(Map<String, Object> params); List<Map<String, Object>> selectValue(Map<String, Object> params);
// 根据传入的参数Map进行时间统计查询返回一个包含多个键值对Map的列表
List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params); List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params);
} }

@ -1,24 +1,17 @@
package com.service; // 声明该类所在的包为com.service
// 导入Map接口用于存储键值对常作为方法的参数传递参数集合 package com.service;
import java.util.Map; import java.util.Map;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口这是MyBatis-Plus提供的通用服务接口
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入实体类ConfigEntity代表系统配置的实体对象
import com.entity.ConfigEntity; import com.entity.ConfigEntity;
// 导入自定义的分页工具类PageUtils用于处理分页相关操作
import com.utils.PageUtils; import com.utils.PageUtils;
/** /**
* *
*/ */
public interface ConfigService extends IService<ConfigEntity> { public interface ConfigService extends IService<ConfigEntity> {
// 定义一个查询分页数据的方法 PageUtils queryPage(Map<String, Object> params,Wrapper<ConfigEntity> wrapper);
// 参数params是一个Map用于传递查询所需的参数如页码、每页数量等 }
// 参数wrapper是一个Wrapper<ConfigEntity>对象用于构建对ConfigEntity实体的查询条件
// 该方法返回一个PageUtils对象包含了分页查询的结果信息
PageUtils queryPage(Map<String, Object> params, Wrapper<ConfigEntity> wrapper);
}

@ -1,47 +1,37 @@
package com.service; // 声明该类所在的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口这是MyBatis-Plus提供的通用服务接口
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类PageUtils用于处理分页相关操作
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入酒店简介评论表的实体类
import com.entity.DiscussjiudianjianjieEntity; import com.entity.DiscussjiudianjianjieEntity;
// 导入List接口用于存储多个元素
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对
import java.util.Map; import java.util.Map;
// 导入酒店简介评论表的VO视图对象用于封装特定视图所需的数据
import com.entity.vo.DiscussjiudianjianjieVO; import com.entity.vo.DiscussjiudianjianjieVO;
// 导入MyBatis的Param注解用于指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入酒店简介评论表的View视图类用于封装特定视图所需的数据
import com.entity.view.DiscussjiudianjianjieView; import com.entity.view.DiscussjiudianjianjieView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:05 * @date 2022-04-04 00:20:05
*/ */
public interface DiscussjiudianjianjieService extends IService<DiscussjiudianjianjieEntity> { public interface DiscussjiudianjianjieService extends IService<DiscussjiudianjianjieEntity> {
// 根据传入的参数进行分页查询返回一个包含分页信息的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询出符合条件的酒店简介评论VO列表
List<DiscussjiudianjianjieVO> selectListVO(Wrapper<DiscussjiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个酒店简介评论VO对象
DiscussjiudianjianjieVO selectVO(@Param("ew") Wrapper<DiscussjiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的酒店简介评论视图列表 PageUtils queryPage(Map<String, Object> params);
List<DiscussjiudianjianjieView> selectListView(Wrapper<DiscussjiudianjianjieEntity> wrapper);
List<DiscussjiudianjianjieVO> selectListVO(Wrapper<DiscussjiudianjianjieEntity> wrapper);
DiscussjiudianjianjieVO selectVO(@Param("ew") Wrapper<DiscussjiudianjianjieEntity> wrapper);
List<DiscussjiudianjianjieView> selectListView(Wrapper<DiscussjiudianjianjieEntity> wrapper);
DiscussjiudianjianjieView selectView(@Param("ew") Wrapper<DiscussjiudianjianjieEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<DiscussjiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个酒店简介评论视图对象
DiscussjiudianjianjieView selectView(@Param("ew") Wrapper<DiscussjiudianjianjieEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回一个包含分页信息的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<DiscussjiudianjianjieEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该Java类所在的包为com.service package com.service;
// 导入MyBatis-Plus框架中的Wrapper类用于构建动态查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus框架提供的通用IService接口该接口包含了常见的增删改查等操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询的相关逻辑
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入酒店客房评论表对应的实体类,代表数据库中的酒店客房评论表记录
import com.entity.DiscussjiudiankefangEntity; import com.entity.DiscussjiudiankefangEntity;
// 导入List接口用于存储多个对象的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常用于传递查询参数等
import java.util.Map; import java.util.Map;
// 导入酒店客房评论表对应的VOView Object用于封装特定视图展示所需的数据
import com.entity.vo.DiscussjiudiankefangVO; import com.entity.vo.DiscussjiudiankefangVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入酒店客房评论表对应的View类用于封装特定视图展示所需的数据
import com.entity.view.DiscussjiudiankefangView; import com.entity.view.DiscussjiudiankefangView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:05 * @date 2022-04-04 00:20:05
*/ */
// 定义一个服务接口继承自MyBatis-Plus的IService接口泛型指定为酒店客房评论表实体类
public interface DiscussjiudiankefangService extends IService<DiscussjiudiankefangEntity> { public interface DiscussjiudiankefangService extends IService<DiscussjiudiankefangEntity> {
// 根据传入的参数进行分页查询酒店客房评论记录返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询出符合条件的酒店客房评论VO列表返回一个List集合
List<DiscussjiudiankefangVO> selectListVO(Wrapper<DiscussjiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个酒店客房评论VO对象@Param注解指定参数名称为"ew"
DiscussjiudiankefangVO selectVO(@Param("ew") Wrapper<DiscussjiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的酒店客房评论View列表返回一个List集合 PageUtils queryPage(Map<String, Object> params);
List<DiscussjiudiankefangView> selectListView(Wrapper<DiscussjiudiankefangEntity> wrapper);
List<DiscussjiudiankefangVO> selectListVO(Wrapper<DiscussjiudiankefangEntity> wrapper);
DiscussjiudiankefangVO selectVO(@Param("ew") Wrapper<DiscussjiudiankefangEntity> wrapper);
List<DiscussjiudiankefangView> selectListView(Wrapper<DiscussjiudiankefangEntity> wrapper);
DiscussjiudiankefangView selectView(@Param("ew") Wrapper<DiscussjiudiankefangEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<DiscussjiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个酒店客房评论View对象@Param注解指定参数名称为"ew"
DiscussjiudiankefangView selectView(@Param("ew") Wrapper<DiscussjiudiankefangEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询酒店客房评论记录返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<DiscussjiudiankefangEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该类属于com.service包 package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD操作
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入酒店简介实体类
import com.entity.JiudianjianjieEntity; import com.entity.JiudianjianjieEntity;
// 导入List接口用于存储多个元素
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对
import java.util.Map; import java.util.Map;
// 导入酒店简介的VO类用于封装特定视图的数据
import com.entity.vo.JiudianjianjieVO; import com.entity.vo.JiudianjianjieVO;
// 导入MyBatis的@Param注解用于指定参数名
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入酒店简介的View类用于封装特定视图的数据
import com.entity.view.JiudianjianjieView; import com.entity.view.JiudianjianjieView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义一个服务接口继承自IService<JiudianjianjieEntity>,具备对酒店简介实体的通用操作能力
public interface JiudianjianjieService extends IService<JiudianjianjieEntity> { public interface JiudianjianjieService extends IService<JiudianjianjieEntity> {
// 根据传入的参数进行分页查询,返回分页结果
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询符合条件的酒店简介VO列表
List<JiudianjianjieVO> selectListVO(Wrapper<JiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店简介VO对象
JiudianjianjieVO selectVO(@Param("ew") Wrapper<JiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的酒店简介View列表 PageUtils queryPage(Map<String, Object> params);
List<JiudianjianjieView> selectListView(Wrapper<JiudianjianjieEntity> wrapper);
List<JiudianjianjieVO> selectListVO(Wrapper<JiudianjianjieEntity> wrapper);
JiudianjianjieVO selectVO(@Param("ew") Wrapper<JiudianjianjieEntity> wrapper);
List<JiudianjianjieView> selectListView(Wrapper<JiudianjianjieEntity> wrapper);
JiudianjianjieView selectView(@Param("ew") Wrapper<JiudianjianjieEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<JiudianjianjieEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店简介View对象
JiudianjianjieView selectView(@Param("ew") Wrapper<JiudianjianjieEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回分页结果
PageUtils queryPage(Map<String, Object> params, Wrapper<JiudianjianjieEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该类所在的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD服务方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入酒店客房实体类,代表数据库中的酒店客房表记录
import com.entity.JiudiankefangEntity; import com.entity.JiudiankefangEntity;
// 导入List接口用于存储多个对象
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对可作为查询参数
import java.util.Map; import java.util.Map;
// 导入酒店客房值对象类,用于封装特定视图展示所需的数据
import com.entity.vo.JiudiankefangVO; import com.entity.vo.JiudiankefangVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入酒店客房视图类,用于封装特定视图展示所需的数据
import com.entity.view.JiudiankefangView; import com.entity.view.JiudiankefangView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义一个服务接口继承自IService<JiudiankefangEntity>具备对酒店客房实体的基本CRUD操作能力
public interface JiudiankefangService extends IService<JiudiankefangEntity> { public interface JiudiankefangService extends IService<JiudiankefangEntity> {
// 根据传入的参数进行分页查询返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询符合条件的酒店客房VO列表返回List集合
List<JiudiankefangVO> selectListVO(Wrapper<JiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店客房VO对象@Param注解指定参数名称为"ew"
JiudiankefangVO selectVO(@Param("ew") Wrapper<JiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的酒店客房View列表返回List集合 PageUtils queryPage(Map<String, Object> params);
List<JiudiankefangView> selectListView(Wrapper<JiudiankefangEntity> wrapper);
List<JiudiankefangVO> selectListVO(Wrapper<JiudiankefangEntity> wrapper);
JiudiankefangVO selectVO(@Param("ew") Wrapper<JiudiankefangEntity> wrapper);
List<JiudiankefangView> selectListView(Wrapper<JiudiankefangEntity> wrapper);
JiudiankefangView selectView(@Param("ew") Wrapper<JiudiankefangEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<JiudiankefangEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店客房View对象@Param注解指定参数名称为"ew" }
JiudiankefangView selectView(@Param("ew") Wrapper<JiudiankefangEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<JiudiankefangEntity> wrapper);
}

@ -1,49 +1,37 @@
package com.service; // 声明该类所属的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建动态查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的服务层基础方法如增删改查
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入客房类型实体类,代表数据库中客房类型表的记录
import com.entity.KefangleixingEntity; import com.entity.KefangleixingEntity;
// 导入List接口用于存储多个对象的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对可作为查询参数传递
import java.util.Map; import java.util.Map;
// 导入客房类型的值对象类,通常用于封装特定视图展示所需的数据
import com.entity.vo.KefangleixingVO; import com.entity.vo.KefangleixingVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入客房类型的视图类,用于封装特定视图展示所需的数据
import com.entity.view.KefangleixingView; import com.entity.view.KefangleixingView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义客房类型服务接口继承自IService<KefangleixingEntity>意味着具备对客房类型实体的基本CRUD操作能力
public interface KefangleixingService extends IService<KefangleixingEntity> { public interface KefangleixingService extends IService<KefangleixingEntity> {
// 根据传入的参数进行分页查询返回一个包含分页信息和查询结果的PageUtils对象 PageUtils queryPage(Map<String, Object> params);
PageUtils queryPage(Map<String, Object> params);
List<KefangleixingVO> selectListVO(Wrapper<KefangleixingEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的客房类型VO列表返回一个List集合
List<KefangleixingVO> selectListVO(Wrapper<KefangleixingEntity> wrapper); KefangleixingVO selectVO(@Param("ew") Wrapper<KefangleixingEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个客房类型VO对象@Param注解指定参数名为"ew" List<KefangleixingView> selectListView(Wrapper<KefangleixingEntity> wrapper);
KefangleixingVO selectVO(@Param("ew") Wrapper<KefangleixingEntity> wrapper);
KefangleixingView selectView(@Param("ew") Wrapper<KefangleixingEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的客房类型View列表返回一个List集合
List<KefangleixingView> selectListView(Wrapper<KefangleixingEntity> wrapper); PageUtils queryPage(Map<String, Object> params,Wrapper<KefangleixingEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个客房类型View对象@Param注解指定参数名为"ew"
KefangleixingView selectView(@Param("ew") Wrapper<KefangleixingEntity> wrapper); }
// 根据传入的参数和查询条件Wrapper进行分页查询返回一个包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<KefangleixingEntity> wrapper);
}

@ -1,49 +1,37 @@
package com.service; // 声明该Java类所在的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建动态查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口它提供了通用的CRUD创建、读取、更新、删除操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类PageUtils用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入客房预定实体类,代表数据库中客房预定表的记录
import com.entity.KefangyudingEntity; import com.entity.KefangyudingEntity;
// 导入List接口用于存储多个对象的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常用于传递查询参数
import java.util.Map; import java.util.Map;
// 导入客房预定的值对象类,用于封装特定视图展示所需的数据
import com.entity.vo.KefangyudingVO; import com.entity.vo.KefangyudingVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入客房预定的视图类,用于封装特定视图展示所需的数据
import com.entity.view.KefangyudingView; import com.entity.view.KefangyudingView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义客房预定服务接口继承自IService<KefangyudingEntity>意味着它拥有对KefangyudingEntity实体的基本CRUD操作能力
public interface KefangyudingService extends IService<KefangyudingEntity> { public interface KefangyudingService extends IService<KefangyudingEntity> {
// 根据传入的参数进行分页查询返回一个包含分页信息和查询结果的PageUtils对象 PageUtils queryPage(Map<String, Object> params);
PageUtils queryPage(Map<String, Object> params);
List<KefangyudingVO> selectListVO(Wrapper<KefangyudingEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的客房预定VO列表返回一个List集合
List<KefangyudingVO> selectListVO(Wrapper<KefangyudingEntity> wrapper); KefangyudingVO selectVO(@Param("ew") Wrapper<KefangyudingEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个客房预定VO对象@Param注解指定参数名称为"ew" List<KefangyudingView> selectListView(Wrapper<KefangyudingEntity> wrapper);
KefangyudingVO selectVO(@Param("ew") Wrapper<KefangyudingEntity> wrapper);
KefangyudingView selectView(@Param("ew") Wrapper<KefangyudingEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<KefangyudingEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的客房预定View列表返回一个List集合
List<KefangyudingView> selectListView(Wrapper<KefangyudingEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个客房预定View对象@Param注解指定参数名称为"ew"
KefangyudingView selectView(@Param("ew") Wrapper<KefangyudingEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回一个包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<KefangyudingEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该类所属的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口为通用的服务层接口提供了基本的CRUD操作
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询的结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入酒店公告实体类,对应数据库中的酒店公告表
import com.entity.NewsEntity; import com.entity.NewsEntity;
// 导入List接口用于存储多个元素的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常作为查询参数
import java.util.Map; import java.util.Map;
// 导入酒店公告的值对象类,用于封装特定视图展示所需的数据
import com.entity.vo.NewsVO; import com.entity.vo.NewsVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入酒店公告的视图类,用于封装特定视图展示所需的数据
import com.entity.view.NewsView; import com.entity.view.NewsView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义酒店公告服务接口继承自IService<NewsEntity>具备对酒店公告实体的基本CRUD操作能力
public interface NewsService extends IService<NewsEntity> { public interface NewsService extends IService<NewsEntity> {
// 根据传入的参数进行分页查询酒店公告数据返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询符合条件的酒店公告VO列表返回一个List集合
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店公告VO对象@Param注解指定参数名为"ew"
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的酒店公告View列表返回一个List集合 PageUtils queryPage(Map<String, Object> params);
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper);
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper);
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper);
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个酒店公告View对象@Param注解指定参数名为"ew" }
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询酒店公告数据返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper);
}

@ -1,51 +1,37 @@
package com.service; package com.service;
// 声明当前接口所属的包为com.service用于组织和管理相关的类和接口
// 导入MyBatis-Plus的Wrapper类用于构建复杂的查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD增删改查操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类PageUtils用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入入住安排的实体类RuzhuanpaiEntity对应数据库中的表记录
import com.entity.RuzhuanpaiEntity; import com.entity.RuzhuanpaiEntity;
// 导入List接口用于存储多个对象的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常用于传递查询参数
import java.util.Map; import java.util.Map;
// 导入入住安排的值对象类RuzhuanpaiVO用于封装特定视图展示所需的数据
import com.entity.vo.RuzhuanpaiVO; import com.entity.vo.RuzhuanpaiVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入入住安排的视图类RuzhuanpaiView用于封装特定视图展示所需的数据
import com.entity.view.RuzhuanpaiView; import com.entity.view.RuzhuanpaiView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义一个名为RuzhuanpaiService的接口继承自IService<RuzhuanpaiEntity>
// 表示该接口具备对RuzhuanpaiEntity实体的基本CRUD操作能力并且可以扩展自定义的业务方法
public interface RuzhuanpaiService extends IService<RuzhuanpaiEntity> { public interface RuzhuanpaiService extends IService<RuzhuanpaiEntity> {
// 根据传入的参数进行分页查询入住安排数据返回包含分页信息和查询结果的PageUtils对象 PageUtils queryPage(Map<String, Object> params);
PageUtils queryPage(Map<String, Object> params);
List<RuzhuanpaiVO> selectListVO(Wrapper<RuzhuanpaiEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的入住安排VO列表返回一个List集合
List<RuzhuanpaiVO> selectListVO(Wrapper<RuzhuanpaiEntity> wrapper); RuzhuanpaiVO selectVO(@Param("ew") Wrapper<RuzhuanpaiEntity> wrapper);
// 根据传入的查询条件Wrapper参数名为"ew"查询符合条件的单个入住安排VO对象 List<RuzhuanpaiView> selectListView(Wrapper<RuzhuanpaiEntity> wrapper);
RuzhuanpaiVO selectVO(@Param("ew") Wrapper<RuzhuanpaiEntity> wrapper);
RuzhuanpaiView selectView(@Param("ew") Wrapper<RuzhuanpaiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<RuzhuanpaiEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的入住安排View列表返回一个List集合
List<RuzhuanpaiView> selectListView(Wrapper<RuzhuanpaiEntity> wrapper);
// 根据传入的查询条件Wrapper参数名为"ew"查询符合条件的单个入住安排View对象
RuzhuanpaiView selectView(@Param("ew") Wrapper<RuzhuanpaiEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询入住安排数据返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<RuzhuanpaiEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该类所属的包为com.service方便对代码进行模块化管理 package com.service;
// 导入MyBatis-Plus中的Wrapper类用于构建动态的查询条件可灵活定制查询逻辑
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus提供的IService接口它封装了常见的增删改查等通用操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询的结果,方便展示数据
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入收藏表对应的实体类,该实体类与数据库中的收藏表结构相对应
import com.entity.StoreupEntity; import com.entity.StoreupEntity;
// 导入List接口用于存储多个对象可用于存放查询结果集
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对常作为查询参数的容器
import java.util.Map; import java.util.Map;
// 导入收藏表的值对象类,通常用于封装特定业务场景下需要展示的数据
import com.entity.vo.StoreupVO; import com.entity.vo.StoreupVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称增强代码的可读性和可维护性
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入收藏表的视图类,用于封装特定视图展示所需的数据
import com.entity.view.StoreupView; import com.entity.view.StoreupView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义一个服务接口继承自IService<StoreupEntity>,表明该接口具备对收藏表实体的基本操作能力
public interface StoreupService extends IService<StoreupEntity> { public interface StoreupService extends IService<StoreupEntity> {
// 根据传入的参数进行分页查询返回一个包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询出符合条件的收藏表VO列表返回一个List集合
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个收藏表VO对象@Param注解指定参数名称为"ew"
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的收藏表View列表返回一个List集合 PageUtils queryPage(Map<String, Object> params);
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper查询出符合条件的单个收藏表View对象@Param注解指定参数名称为"ew"
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回一个包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper);
} }

@ -1,43 +1,26 @@
package com.service; // 声明该类所属的包为com.service
// 导入List接口用于存储多个对象的集合 package com.service;
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常用于传递参数
import java.util.Map; import java.util.Map;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入Token实体类对应数据库中的token表
import com.entity.TokenEntity; import com.entity.TokenEntity;
// 导入自定义的分页工具类,用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
/** /**
* token * token
*/ */
// 定义TokenService接口继承自IService<TokenEntity>具备对TokenEntity的基本CRUD操作能力
public interface TokenService extends IService<TokenEntity> { public interface TokenService extends IService<TokenEntity> {
// 根据传入的参数进行分页查询返回一个包含分页信息和查询结果的PageUtils对象 PageUtils queryPage(Map<String, Object> params);
PageUtils queryPage(Map<String, Object> params);
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的Token实体列表返回一个List集合
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper); PageUtils queryPage(Map<String, Object> params,Wrapper<TokenEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询返回一个包含分页信息和查询结果的PageUtils对象 String generateToken(Long userid,String username,String tableName, String role);
PageUtils queryPage(Map<String, Object> params, Wrapper<TokenEntity> wrapper);
TokenEntity getTokenEntity(String token);
// 根据用户ID、用户名、表名和角色生成一个token字符串 }
// 参数userid为用户的ID
// 参数username为用户的名称
// 参数tableName为相关表的名称
// 参数role为用户的角色
// 返回生成的token字符串
String generateToken(Long userid, String username, String tableName, String role);
// 根据传入的token字符串查询对应的Token实体对象
// 参数token为要查询的token字符串
// 返回查询到的Token实体对象如果未找到则可能返回null
TokenEntity getTokenEntity(String token);
}

@ -1,35 +1,25 @@
package com.service; // 声明该Java类所属的包为com.service package com.service;
// 导入List接口用于存储多个对象的集合后续会用于存储查询结果
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对通常用于传递查询参数等
import java.util.Map; import java.util.Map;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称增强代码可读性
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入MyBatis-Plus的Wrapper类用于构建动态查询条件可灵活定制查询逻辑
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口它提供了通用的CRUD创建、读取、更新、删除操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入系统用户实体类,代表数据库中系统用户表的记录
import com.entity.UserEntity; import com.entity.UserEntity;
// 导入自定义的分页工具类,用于处理分页查询结果,方便实现分页展示数据
import com.utils.PageUtils; import com.utils.PageUtils;
/** /**
* *
*/ */
// 定义一个名为UserService的接口继承自IService<UserEntity>
// 这意味着该接口具备了IService提供的对UserEntity实体的基本CRUD操作能力
public interface UserService extends IService<UserEntity> { public interface UserService extends IService<UserEntity> {
// 根据传入的参数进行分页查询系统用户数据返回一个包含分页信息和查询结果的PageUtils对象 PageUtils queryPage(Map<String, Object> params);
PageUtils queryPage(Map<String, Object> params);
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的系统用户实体列表返回一个List集合
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper); PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询系统用户数据返回一个包含分页信息和查询结果的PageUtils对象 }
PageUtils queryPage(Map<String, Object> params, Wrapper<UserEntity> wrapper);
}

@ -1,22 +1,13 @@
package com.service; // 声明该类所属的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD操作
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入用户实体类
import com.entity.YonghuEntity; import com.entity.YonghuEntity;
// 导入List接口用于存储多个对象
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对
import java.util.Map; import java.util.Map;
// 导入用户值对象类
import com.entity.vo.YonghuVO; import com.entity.vo.YonghuVO;
// 导入MyBatis的@Param注解用于指定参数名
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入用户视图对象类
import com.entity.view.YonghuView; import com.entity.view.YonghuView;
/** /**
@ -26,7 +17,6 @@ import com.entity.view.YonghuView;
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义用户服务接口继承IService<YonghuEntity>具备基本CRUD能力
public interface YonghuService extends IService<YonghuEntity> { public interface YonghuService extends IService<YonghuEntity> {
/** /**
@ -35,7 +25,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param params * @param params
* @return PageUtils 便 * @return PageUtils 便
*/ */
// 根据参数进行分页查询用户数据
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
/** /**
@ -45,7 +34,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param wrapper WHERE * @param wrapper WHERE
* @return YonghuVO * @return YonghuVO
*/ */
// 根据查询条件查询用户VO列表
List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper); List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper);
/** /**
@ -55,7 +43,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param wrapper * @param wrapper
* @return YonghuVO null * @return YonghuVO null
*/ */
// 根据查询条件查询单个用户VO对象
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper); YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
/** /**
@ -65,7 +52,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param wrapper * @param wrapper
* @return YonghuView * @return YonghuView
*/ */
// 根据查询条件查询用户View列表
List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper); List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper);
/** /**
@ -75,7 +61,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param wrapper * @param wrapper
* @return YonghuView null * @return YonghuView null
*/ */
// 根据查询条件查询单个用户View对象
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper); YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
/** /**
@ -85,6 +70,6 @@ public interface YonghuService extends IService<YonghuEntity> {
* @param wrapper WHERE * @param wrapper WHERE
* @return PageUtils 便 * @return PageUtils 便
*/ */
// 根据参数和查询条件进行分页查询用户数据
PageUtils queryPage(Map<String, Object> params, Wrapper<YonghuEntity> wrapper); PageUtils queryPage(Map<String, Object> params, Wrapper<YonghuEntity> wrapper);
} }

@ -1,48 +1,37 @@
package com.service; // 声明该类所在的包为com.service package com.service;
// 导入MyBatis-Plus的Wrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入MyBatis-Plus的IService接口提供通用的CRUD操作方法
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
// 导入自定义的分页工具类,用于处理分页查询结果
import com.utils.PageUtils; import com.utils.PageUtils;
// 导入员工实体类,对应数据库中的员工表
import com.entity.YuangongEntity; import com.entity.YuangongEntity;
// 导入List接口用于存储多个元素的集合
import java.util.List; import java.util.List;
// 导入Map接口用于存储键值对可作为查询参数
import java.util.Map; import java.util.Map;
// 导入员工值对象类,通常用于封装特定业务场景下需要展示的数据
import com.entity.vo.YuangongVO; import com.entity.vo.YuangongVO;
// 导入MyBatis的@Param注解用于在Mapper方法中指定参数名称
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
// 导入员工视图类,用于封装特定视图展示所需的数据
import com.entity.view.YuangongView; import com.entity.view.YuangongView;
/** /**
* *
* *
* @author * @author
* @email * @email
* @date 2022-04-04 00:20:04 * @date 2022-04-04 00:20:04
*/ */
// 定义员工服务接口继承自IService<YuangongEntity>具备对员工实体的基本CRUD操作能力
public interface YuangongService extends IService<YuangongEntity> { public interface YuangongService extends IService<YuangongEntity> {
// 根据传入的参数进行分页查询员工数据返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params);
// 根据传入的查询条件Wrapper查询符合条件的员工VO列表返回一个List集合
List<YuangongVO> selectListVO(Wrapper<YuangongEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个员工VO对象@Param注解指定参数名为"ew"
YuangongVO selectVO(@Param("ew") Wrapper<YuangongEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的员工View列表返回一个List集合 PageUtils queryPage(Map<String, Object> params);
List<YuangongView> selectListView(Wrapper<YuangongEntity> wrapper);
List<YuangongVO> selectListVO(Wrapper<YuangongEntity> wrapper);
YuangongVO selectVO(@Param("ew") Wrapper<YuangongEntity> wrapper);
List<YuangongView> selectListView(Wrapper<YuangongEntity> wrapper);
YuangongView selectView(@Param("ew") Wrapper<YuangongEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<YuangongEntity> wrapper);
// 根据传入的查询条件Wrapper查询符合条件的单个员工View对象@Param注解指定参数名为"ew" }
YuangongView selectView(@Param("ew") Wrapper<YuangongEntity> wrapper);
// 根据传入的参数和查询条件Wrapper进行分页查询员工数据返回包含分页信息和查询结果的PageUtils对象
PageUtils queryPage(Map<String, Object> params, Wrapper<YuangongEntity> wrapper);
}

@ -10,85 +10,72 @@ import java.util.Map;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* : API 访 token * :
*/ */
public class BaiduUtil {
public class BaiduUtil {
/** /**
* *
* * @param lon
* @param key API 访ak * @param lat
* @param lng * @param coordtype
* @param lat * @return
* @return Map null
*/ */
public static Map<String, String> getCityByLonLat(String key, String lng, String lat) { public static Map<String, String> getCityByLonLat(String key, String lng, String lat) {
// 将纬度和经度拼接成百度地图 API 所需的 location 格式
String location = lat + "," + lng; String location = lat + "," + lng;
try { try {
// 拼装请求 URL包含 API 密钥、输出格式、经纬度坐标系和经纬度信息 //拼装url
String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak=" + key + "&output=json&coordtype=wgs84ll&location=" + location; String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location;
// 发送 GET 请求并获取结果
String result = HttpClientUtils.doGet(url); String result = HttpClientUtils.doGet(url);
// 将结果解析为 JSONObject 对象
JSONObject o = new JSONObject(result); JSONObject o = new JSONObject(result);
// 创建一个 Map 用于存储省市区街道信息
Map<String, String> area = new HashMap<>(); Map<String, String> area = new HashMap<>();
// 从 JSONObject 中提取省份信息并放入 Map area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province"));
area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province")); area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city"));
// 从 JSONObject 中提取城市信息并放入 Map area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city")); area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
// 从 JSONObject 中提取区信息并放入 Map
area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
// 从 JSONObject 中提取街道信息并放入 Map
area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
return area; return area;
} catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
/** /**
* API 访 token * API访token
* token . * token.
* * @param ak - API Key
* @param ak API Key * @param sk - Securet Key
* @param sk Securet Key * @return assess_token
* @return access_token null */
*/
public static String getAuth(String ak, String sk) { public static String getAuth(String ak, String sk) {
// 获取 token地址 // 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
// 拼接完整的获取 token 的 URL包含授权类型、API Key 和 Secret Key
String getAccessTokenUrl = authHost String getAccessTokenUrl = authHost
// 1. grant_type 为固定参数 // 1. grant_type为固定参数
+ "grant_type=client_credentials" + "grant_type=client_credentials"
// 2. 官网获取的 API Key // 2. 官网获取的 API Key
+ "&client_id=" + ak + "&client_id=" + ak
// 3. 官网获取的 Secret Key // 3. 官网获取的 Secret Key
+ "&client_secret=" + sk; + "&client_secret=" + sk;
try { try {
// 创建 URL 对象
URL realUrl = new URL(getAccessTokenUrl); URL realUrl = new URL(getAccessTokenUrl);
// 打开和 URL 之间的连接 // 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection(); HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
// 设置请求方法为 GET
connection.setRequestMethod("GET"); connection.setRequestMethod("GET");
// 建立连接
connection.connect(); connection.connect();
// 获取所有响应头字段 // 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields(); Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段并打印(调试用) // 遍历所有的响应头字段
for (String key : map.keySet()) { for (String key : map.keySet()) {
System.err.println(key + "--->" + map.get(key)); System.err.println(key + "--->" + map.get(key));
} }
// 定义 BufferedReader 输入流来读取 URL 的响应 // 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result = ""; String result = "";
String line; String line;
// 逐行读取响应内容并拼接
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
result += line; result += line;
} }
@ -96,15 +83,14 @@ public class BaiduUtil {
* *
*/ */
System.err.println("result:" + result); System.err.println("result:" + result);
// 将响应结果解析为 JSONObject 对象
org.json.JSONObject jsonObject = new org.json.JSONObject(result); org.json.JSONObject jsonObject = new org.json.JSONObject(result);
// 从 JSONObject 中提取 access_token 并返回
String access_token = jsonObject.getString("access_token"); String access_token = jsonObject.getString("access_token");
return access_token; return access_token;
} catch (Exception e) { } catch (Exception e) {
System.err.printf("获取 token 失败!"); System.err.printf("获取token失败");
e.printStackTrace(System.err); e.printStackTrace(System.err);
} }
return null; return null;
} }
} }

@ -7,91 +7,69 @@ import org.apache.poi.ss.usermodel.Cell;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Objects; import java.util.Objects;
// 使用 Spring 的 @Component 注解,将该类标记为一个组件,以便在 Spring 容器中进行管理
@Component @Component
public class CommonUtil { public class CommonUtil {
/**
/**
* *
* *
* @param num * @param num
* @return * @return
*/ */
public static String getRandomString(Integer num) { public static String getRandomString(Integer num) {
// 定义包含小写字母和数字的字符集
String base = "abcdefghijklmnopqrstuvwxyz0123456789"; String base = "abcdefghijklmnopqrstuvwxyz0123456789";
// 创建一个 Random 实例用于生成随机数
Random random = new Random(); Random random = new Random();
// 使用 StringBuffer 来构建随机字符串
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
// 循环生成指定长度的随机字符串
for (int i = 0; i < num; i++) { for (int i = 0; i < num; i++) {
// 生成一个在字符集范围内的随机索引
int number = random.nextInt(base.length()); int number = random.nextInt(base.length());
// 将随机索引对应的字符添加到 StringBuffer 中
sb.append(base.charAt(number)); sb.append(base.charAt(number));
} }
// 将 StringBuffer 转换为字符串并返回
return sb.toString(); return sb.toString();
} }
/** /**
* *
* *
* @param num * @param num
* @return * @return
*/ */
public static String getRandomNumber(Integer num) { public static String getRandomNumber(Integer num) {
// 定义仅包含数字的字符集 String base = "0123456789";
String base = "0123456789"; Random random = new Random();
// 创建一个 Random 实例用于生成随机数 StringBuffer sb = new StringBuffer();
Random random = new Random(); for (int i = 0; i < num; i++) {
// 使用 StringBuffer 来构建随机验证码 int number = random.nextInt(base.length());
StringBuffer sb = new StringBuffer(); sb.append(base.charAt(number));
// 循环生成指定长度的随机验证码 }
for (int i = 0; i < num; i++) { return sb.toString();
// 生成一个在字符集范围内的随机索引 }
int number = random.nextInt(base.length());
// 将随机索引对应的字符添加到 StringBuffer 中
sb.append(base.charAt(number));
}
// 将 StringBuffer 转换为字符串并返回
return sb.toString();
}
public static String getCellValue(Cell cell) { public static String getCellValue(Cell cell) {
// 初始化结果值为空字符串
String resultValue = ""; String resultValue = "";
// 检查单元格是否为 // 判空
if (Objects.isNull(cell)) { if (Objects.isNull(cell)) {
// 如果单元格为空,直接返回空字符串
return resultValue; return resultValue;
} }
// 获取单元格的类型 // 拿到单元格类型
int cellType = cell.getCellType(); int cellType = cell.getCellType();
// 根据单元格类型进行处理
switch (cellType) { switch (cellType) {
// 如果是字符串类型的单元格 // 字符串类型
case Cell.CELL_TYPE_STRING: case Cell.CELL_TYPE_STRING:
// 获取字符串值并去除两端空格,如果值为空则返回空字符串 resultValue = StringUtils.isEmpty(cell.getStringCellValue()) ? "" : cell.getStringCellValue().trim();
resultValue = StringUtils.isEmpty(cell.getStringCellValue())? "" : cell.getStringCellValue().trim();
break; break;
// 如果是布尔类型的单元格 // 布尔类型
case Cell.CELL_TYPE_BOOLEAN: case Cell.CELL_TYPE_BOOLEAN:
// 将布尔值转换为字符串
resultValue = String.valueOf(cell.getBooleanCellValue()); resultValue = String.valueOf(cell.getBooleanCellValue());
break; break;
// 如果是数值类型的单元格 // 数值类型
case Cell.CELL_TYPE_NUMERIC: case Cell.CELL_TYPE_NUMERIC:
// 使用 DecimalFormat 格式化数值,保留六位小数
resultValue = new DecimalFormat("#.######").format(cell.getNumericCellValue()); resultValue = new DecimalFormat("#.######").format(cell.getNumericCellValue());
break; break;
// 其他情况(默认),不做处理,结果值仍为空字符 // 取空
default: default:
break; break;
} }
// 返回处理后的单元格值
return resultValue; return resultValue;
} }
}
}

@ -7,33 +7,21 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
/** /**
* : * :
*/ */
public class FileUtil {
/** public class FileUtil {
*
*
* @param file
* @return
* @throws IOException I/O
*/
public static byte[] FileToByte(File file) throws IOException { public static byte[] FileToByte(File file) throws IOException {
// 将文件数据转输入,这里使用 FileInputStream 来读取文件内容 // 将数据转为流
@SuppressWarnings("resource") @SuppressWarnings("resource")
InputStream content = new FileInputStream(file); InputStream content = new FileInputStream(file);
// 创建一个 ByteArrayOutputStream 用于存储从文件中读取的数据
ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
// 创建一个字节缓冲区,用于每次从输入流中读取数据
byte[] buff = new byte[100]; byte[] buff = new byte[100];
// 用于存储每次读取的字节数
int rc = 0; int rc = 0;
// 循环读取文件内容直到读取完所有数据read 方法返回 -1 表示读取到文件末尾)
while ((rc = content.read(buff, 0, 100)) > 0) { while ((rc = content.read(buff, 0, 100)) > 0) {
// 将读取到的字节写入到 ByteArrayOutputStream 中
swapStream.write(buff, 0, rc); swapStream.write(buff, 0, rc);
} }
// 将 ByteArrayOutputStream 中的数据转换为字节数组并返回 // 获得二进制数组
return swapStream.toByteArray(); return swapStream.toByteArray();
} }
} }

@ -5,49 +5,38 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
/** /**
* HttpClient * HttpClient
* HTTP GETURL
*/ */
public class HttpClientUtils { public class HttpClientUtils {
/** /**
* HTTP GET * @param uri
* * @return String
* @param uri URLURI * @description get
* @return null
* @description URLHttpURLConnection
*
* @author: long.he01 * @author: long.he01
*/ */
public static String doGet(String uri) { public static String doGet(String uri) {
// 使用StringBuilder来构建最终的响应结果字符串因为频繁的字符串拼接操作使用StringBuilder效率更高
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
try { try {
// 用于存储每一行读取到的响应数据
String res = ""; String res = "";
// 根据传入的URI创建URL对象
URL url = new URL(uri); URL url = new URL(uri);
// 打开与URL的连接并将其强转为HttpURLConnection类型以便进行HTTP相关的操作
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// 创建一个BufferedReader用于从连接的输入流中读取数据指定字符编码为UTF-8
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
// 用于存储从输入流中读取的每一行数据
String line; String line;
// 循环读取输入流中的数据直到读取到文件末尾readLine()返回null表示文件末尾
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
// 将读取到的每一行数据拼接起来,并添加换行符 res += line+"\n";
res += line + "\n";
} }
// 关闭BufferedReader释放资源
in.close(); in.close();
// 返回拼接好的响应结果字符串
return res; return res;
} catch (Exception e) { }catch (Exception e) {
// 如果在请求过程中发生异常,打印异常堆栈信息
e.printStackTrace(); e.printStackTrace();
// 请求失败返回null
return null; return null;
} }
} }
}
}

@ -1,98 +1,54 @@
package com.utils; package com.utils;
/** public class JQPageInfo{
* JQPageInfo 使 jQuery jqGrid
* 使便
*/
public class JQPageInfo {
// 当前页码,通常从 1 开始,代表用户当前查看的页面
private Integer page; private Integer page;
// 每页显示的记录数量,用于控制每页展示的数据量
private Integer limit; private Integer limit;
// 排序字段,指定按照数据库表中的哪个字段进行排序操作
private String sidx; private String sidx;
// 排序顺序,一般取值为 "asc"(升序)或 "desc"(降序)
private String order; private String order;
// 偏移量,用于数据库查询时定位从哪条记录开始获取数据,通常由 (page - 1) * limit 计算得出
private Integer offset; private Integer offset;
/**
*
* @return
*/
public Integer getPage() { public Integer getPage() {
return page; return page;
} }
/**
*
* @param page
*/
public void setPage(Integer page) { public void setPage(Integer page) {
this.page = page; this.page = page;
} }
/**
*
* @return
*/
public Integer getLimit() { public Integer getLimit() {
return limit; return limit;
} }
/**
*
* @param limit
*/
public void setLimit(Integer limit) { public void setLimit(Integer limit) {
this.limit = limit; this.limit = limit;
} }
/**
*
* @return
*/
public String getSidx() { public String getSidx() {
return sidx; return sidx;
} }
/**
*
* @param sidx
*/
public void setSidx(String sidx) { public void setSidx(String sidx) {
this.sidx = sidx; this.sidx = sidx;
} }
/**
*
* @return "asc" "desc"
*/
public String getOrder() { public String getOrder() {
return order; return order;
} }
/**
*
* @param order
*/
public void setOrder(String order) { public void setOrder(String order) {
this.order = order; this.order = order;
} }
/**
*
* @return
*/
public Integer getOffset() { public Integer getOffset() {
return offset; return offset;
} }
/**
*
* @param offset
*/
public void setOffset(Integer offset) { public void setOffset(Integer offset) {
this.offset = offset; this.offset = offset;
} }
}
}

@ -1,25 +1,19 @@
package com.utils; package com.utils;
// 引入Hutool工具包中的DigestUtil类该类提供了各种摘要算法工具用于实现MD5加密
import cn.hutool.crypto.digest.DigestUtil; import cn.hutool.crypto.digest.DigestUtil;
/**
* MD5UtilMD5HutoolDigestUtil
*/
public class MD5Util { public class MD5Util {
/** /**
* MD5 * @param text
* * @param key
* @param text * @return
* @return MD5
*/ */
// 带秘钥加密不过此方法当前未使用密钥仅对文本进行MD5加密 // 带秘钥加密
public static String md5(String text) { public static String md5(String text) {
// 利用DigestUtil类的md5Hex方法对传入的明文进行MD5加密并将加密结果以十六进制字符串形式存储
// 加密后的字符串 // 加密后的字符串
String md5str = DigestUtil.md5Hex(text); String md5str = DigestUtil.md5Hex(text);
// 返回加密后的十六进制字符串
return md5str; return md5str;
} }
}
}

@ -13,218 +13,132 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
/** /**
* Mybatis-Plus * Mybatis-Plus
* MyBatis-Plus
*
*/ */
public class MPUtil { public class MPUtil {
public static final char UNDERLINE = '_'; public static final char UNDERLINE = '_';
/**
* MyBatis-PlusallEQ //mybatis plus allEQ 表达式转换
* 使BeanUtilMapMap线 public static Map allEQMapPre(Object bean,String pre) {
* Map Map<String, Object> map =BeanUtil.beanToMap(bean);
* return camelToUnderlineMap(map,pre);
* @param bean }
* @param pre
* @return Map线 //mybatis plus allEQ 表达式转换
*/ public static Map allEQMap(Object bean) {
public static Map allEQMapPre(Object bean, String pre) { Map<String, Object> map =BeanUtil.beanToMap(bean);
Map<String, Object> map = BeanUtil.beanToMap(bean); return camelToUnderlineMap(map,"");
return camelToUnderlineMap(map, pre); }
}
public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) {
/** Map<String, Object> map =BeanUtil.beanToMap(bean);
* MyBatis-PlusallEQ Map result = camelToUnderlineMap(map,pre);
* 使BeanUtilMapMap线
* Map return genLike(wrapper,result);
*
* @param bean
* @return Map线
*/
public static Map allEQMap(Object bean) {
Map<String, Object> map = BeanUtil.beanToMap(bean);
return camelToUnderlineMap(map, "");
}
/**
* MyBatis-PlusWrapperlike
* MapMap线
* 使MaplikeWrapper
*
* @param wrapper MyBatis-PlusWrapper
* @param bean
* @param pre
* @return likeWrapper
*/
public static Wrapper allLikePre(Wrapper wrapper, Object bean, String pre) {
Map<String, Object> map = BeanUtil.beanToMap(bean);
Map result = camelToUnderlineMap(map, pre);
return genLike(wrapper, result);
}
/**
* MyBatis-PlusWrapperlike
* Map使MaplikeWrapper
*
* @param wrapper MyBatis-PlusWrapper
* @param bean
* @return likeWrapper
*/
public static Wrapper allLike(Wrapper wrapper, Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
return genLike(wrapper, result);
}
/**
* MapMyBatis-PlusWrapperlike
* Maplike使and
*
* @param wrapper MyBatis-PlusWrapper
* @param param Map
* @return likeWrapper
*/
public static Wrapper genLike(Wrapper wrapper, Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) wrapper.and();
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String value = (String) entry.getValue();
wrapper.like(key, value);
i++;
} }
return wrapper;
} public static Wrapper allLike(Wrapper wrapper,Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
/** return genLike(wrapper,result);
* MyBatis-PlusWrapperlikeeq }
* MapMap"%"likeeq
*
* @param wrapper MyBatis-PlusWrapper public static Wrapper genLike( Wrapper wrapper,Map param) {
* @param bean Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
* @return likeeqWrapper int i=0;
*/ while (it.hasNext()) {
public static Wrapper likeOrEq(Wrapper wrapper, Object bean) { if(i>0) wrapper.and();
Map result = BeanUtil.beanToMap(bean, true, true); Map.Entry<String, Object> entry = it.next();
return genLikeOrEq(wrapper, result); String key = entry.getKey();
} String value = (String) entry.getValue();
wrapper.like(key, value);
/** i++;
* MapMyBatis-PlusWrapperlikeeq
* Map"%"likeeq使and
*
* @param wrapper MyBatis-PlusWrapper
* @param param Map
* @return likeeqWrapper
*/
public static Wrapper genLikeOrEq(Wrapper wrapper, Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) wrapper.and();
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
if (entry.getValue().toString().contains("%")) {
wrapper.like(key, entry.getValue().toString().replace("%", ""));
} else {
wrapper.eq(key, entry.getValue());
} }
i++; return wrapper;
} }
return wrapper;
} public static Wrapper likeOrEq(Wrapper wrapper,Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
/** return genLikeOrEq(wrapper,result);
* MyBatis-PlusWrappereq
* Map使MapeqWrapper
*
* @param wrapper MyBatis-PlusWrapper
* @param bean
* @return eqWrapper
*/
public static Wrapper allEq(Wrapper wrapper, Object bean) {
Map result = BeanUtil.beanToMap(bean, true, true);
return genEq(wrapper, result);
}
/**
* MapMyBatis-PlusWrappereq
* Mapeq使and
*
* @param wrapper MyBatis-PlusWrapper
* @param param Map
* @return eqWrapper
*/
public static Wrapper genEq(Wrapper wrapper, Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i = 0;
while (it.hasNext()) {
if (i > 0) wrapper.and();
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
wrapper.eq(key, entry.getValue());
i++;
} }
return wrapper;
} public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
/** int i=0;
* MapMyBatis-PlusWrapperbetween while (it.hasNext()) {
* Map"_start""_end"gele if(i>0) wrapper.and();
* Map.Entry<String, Object> entry = it.next();
* @param wrapper MyBatis-PlusWrapper String key = entry.getKey();
* @param params Map if(entry.getValue().toString().contains("%")) {
* @return betweenWrapper wrapper.like(key, entry.getValue().toString().replace("%", ""));
*/ } else {
public static Wrapper between(Wrapper wrapper, Map<String, Object> params) { wrapper.eq(key, entry.getValue());
for (String key : params.keySet()) {
String columnName = "";
if (key.endsWith("_start")) {
columnName = key.substring(0, key.indexOf("_start"));
if (StringUtils.isNotBlank(params.get(key).toString())) {
wrapper.ge(columnName, params.get(key));
} }
i++;
} }
if (key.endsWith("_end")) { return wrapper;
columnName = key.substring(0, key.indexOf("_end")); }
if (StringUtils.isNotBlank(params.get(key).toString())) {
wrapper.le(columnName, params.get(key)); public static Wrapper allEq(Wrapper wrapper,Object bean) {
} Map result = BeanUtil.beanToMap(bean, true, true);
return genEq(wrapper,result);
}
public static Wrapper genEq( Wrapper wrapper,Map param) {
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
int i=0;
while (it.hasNext()) {
if(i>0) wrapper.and();
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
wrapper.eq(key, entry.getValue());
i++;
} }
return wrapper;
} }
return wrapper;
}
public static Wrapper between(Wrapper wrapper,Map<String, Object> params) {
/** for(String key : params.keySet()) {
* MapMyBatis-PlusWrapper String columnName = "";
* "order""sort" if(key.endsWith("_start")) {
* columnName = key.substring(0, key.indexOf("_start"));
* @param wrapper MyBatis-PlusWrapper if(StringUtils.isNotBlank(params.get(key).toString())) {
* @param params Map"order""sort" wrapper.ge(columnName, params.get(key));
* @return Wrapper }
*/ }
public static Wrapper sort(Wrapper wrapper, Map<String, Object> params) { if(key.endsWith("_end")) {
String order = ""; columnName = key.substring(0, key.indexOf("_end"));
if (params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) { if(StringUtils.isNotBlank(params.get(key).toString())) {
order = params.get("order").toString(); wrapper.le(columnName, params.get(key));
}
}
}
return wrapper;
} }
if (params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
if (order.equalsIgnoreCase("desc")) { public static Wrapper sort(Wrapper wrapper,Map<String, Object> params) {
wrapper.orderDesc(Arrays.asList(params.get("sort"))); String order = "";
} else { if(params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) {
wrapper.orderAsc(Arrays.asList(params.get("sort"))); order = params.get("order").toString();
} }
if(params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
if(order.equalsIgnoreCase("desc")) {
wrapper.orderDesc(Arrays.asList(params.get("sort")));
} else {
wrapper.orderAsc(Arrays.asList(params.get("sort")));
}
}
return wrapper;
} }
return wrapper;
}
/** /**
* 线 * 线
* 线 *
* * @param param
* @param param * @return
* @return 线
*/ */
public static String camelToUnderline(String param) { public static String camelToUnderline(String param) {
if (param == null || "".equals(param.trim())) { if (param == null || "".equals(param.trim())) {
@ -247,16 +161,9 @@ public class MPUtil {
public static void main(String[] ages) { public static void main(String[] ages) {
System.out.println(camelToUnderline("ABCddfANM")); System.out.println(camelToUnderline("ABCddfANM"));
} }
/**
* Map线
* Map线Map
*
* @param param Map
* @param pre
* @return Map线
*/
public static Map camelToUnderlineMap(Map param, String pre) { public static Map camelToUnderlineMap(Map param, String pre) {
Map<String, Object> newMap = new HashMap<String, Object>(); Map<String, Object> newMap = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator(); Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
@ -268,9 +175,10 @@ public class MPUtil {
} else if (StringUtils.isEmpty(pre)) { } else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue()); newMap.put(newKey, entry.getValue());
} else { } else {
newMap.put(pre + "." + newKey, entry.getValue()); newMap.put(pre + "." + newKey, entry.getValue());
} }
} }
return newMap; return newMap;
} }
} }

@ -1,3 +1,4 @@
package com.utils; package com.utils;
import java.io.Serializable; import java.io.Serializable;
@ -8,45 +9,37 @@ import com.baomidou.mybatisplus.plugins.Page;
/** /**
* *
* 便
*/ */
public class PageUtils implements Serializable { public class PageUtils implements Serializable {
// 用于实现序列化版本控制,确保不同版本的类在反序列化时的兼容性
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
// 总记录数,即满足查询条件的所有记录的数量 //总记录数
private long total; private long total;
// 每页记录数,指定每一页显示的记录数量 //每页记录数
private int pageSize; private int pageSize;
// 总页数,根据总记录数和每页记录数计算得出的总页数 //总页数
private long totalPage; private long totalPage;
// 当前页数,标识当前处于第几页 //当前页数
private int currPage; private int currPage;
// 列表数据,存储当前页的具体数据记录 //列表数据
private List<?> list; private List<?> list;
/** /**
* *
* * @param list
* * @param totalCount
* @param list * @param pageSize
* @param totalCount * @param currPage
* @param pageSize
* @param currPage
*/ */
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) { public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list; this.list = list;
this.total = totalCount; this.total = totalCount;
this.pageSize = pageSize; this.pageSize = pageSize;
this.currPage = currPage; this.currPage = currPage;
// 计算总页数,使用向上取整的方式确保所有记录都能被包含在某一页中 this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
} }
/** /**
* *
* MyBatis-PlusPagePage
*
* @param page MyBatis-PlusPage
*/ */
public PageUtils(Page<?> page) { public PageUtils(Page<?> page) {
this.list = page.getRecords(); this.list = page.getRecords();
@ -55,66 +48,54 @@ public class PageUtils implements Serializable {
this.currPage = page.getCurrent(); this.currPage = page.getCurrent();
this.totalPage = page.getPages(); this.totalPage = page.getPages();
} }
/** /*
* *
* Map使QueryPage
*
* @param params Map
*/ */
public PageUtils(Map<String, Object> params) { public PageUtils(Map<String, Object> params) {
Page page = new Query(params).getPage(); Page page =new Query(params).getPage();
// 使用获取到的Page对象再次调用另一个构造函数来初始化分页工具类
new PageUtils(page); new PageUtils(page);
} }
// 获取每页记录数
public int getPageSize() { public int getPageSize() {
return pageSize; return pageSize;
} }
// 设置每页记录数
public void setPageSize(int pageSize) { public void setPageSize(int pageSize) {
this.pageSize = pageSize; this.pageSize = pageSize;
} }
// 获取当前页数
public int getCurrPage() { public int getCurrPage() {
return currPage; return currPage;
} }
// 设置当前页数
public void setCurrPage(int currPage) { public void setCurrPage(int currPage) {
this.currPage = currPage; this.currPage = currPage;
} }
// 获取列表数据
public List<?> getList() { public List<?> getList() {
return list; return list;
} }
// 设置列表数据
public void setList(List<?> list) { public void setList(List<?> list) {
this.list = list; this.list = list;
} }
// 获取总页数
public long getTotalPage() { public long getTotalPage() {
return totalPage; return totalPage;
} }
// 设置总页数
public void setTotalPage(long totalPage) { public void setTotalPage(long totalPage) {
this.totalPage = totalPage; this.totalPage = totalPage;
} }
// 获取总记录数
public long getTotal() { public long getTotal() {
return total; return total;
} }
// 设置总记录数
public void setTotal(long total) { public void setTotal(long total) {
this.total = total; this.total = total;
} }
}
}

@ -1,3 +1,4 @@
package com.utils; package com.utils;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@ -8,114 +9,90 @@ import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
/** /**
* LinkedHashMap<String, Object> *
* SQL
*/ */
public class Query<T> extends LinkedHashMap<String, Object> { public class Query<T> extends LinkedHashMap<String, Object> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* mybatis-plus * mybatis-plus
*/ */
private Page<T> page; private Page<T> page;
/** /**
* 1 *
*/ */
private int currPage = 1; private int currPage = 1;
/** /**
* 10 *
*/ */
private int limit = 10; private int limit = 10;
/**
* JQPageInfo
*
* @param pageInfo JQPageInfo
*/
public Query(JQPageInfo pageInfo) { public Query(JQPageInfo pageInfo) {
// 处理分页参数 //分页参数
if (pageInfo.getPage() != null) { if(pageInfo.getPage()!= null){
currPage = pageInfo.getPage(); currPage = pageInfo.getPage();
} }
if (pageInfo.getLimit() != null) { if(pageInfo.getLimit()!= null){
limit = pageInfo.getLimit(); limit = pageInfo.getLimit();
} }
// 防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
//防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String sidx = SQLFilter.sqlInject(pageInfo.getSidx()); String sidx = SQLFilter.sqlInject(pageInfo.getSidx());
String order = SQLFilter.sqlInject(pageInfo.getOrder()); String order = SQLFilter.sqlInject(pageInfo.getOrder());
// 创建mybatis-plus分页对象 //mybatis-plus分页
this.page = new Page<>(currPage, limit); this.page = new Page<>(currPage, limit);
// 进行排序设置 //排序
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) { if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx); this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order)); this.page.setAsc("ASC".equalsIgnoreCase(order));
} }
} }
/**
* Map public Query(Map<String, Object> params){
*
* @param params Map
*/
public Query(Map<String, Object> params) {
// 将传入的参数Map中的所有键值对放入当前对象中
this.putAll(params); this.putAll(params);
// 处理分页参数 //分页参数
if (params.get("page") != null) { if(params.get("page") != null){
currPage = Integer.parseInt((String) params.get("page")); currPage = Integer.parseInt((String)params.get("page"));
} }
if (params.get("limit") != null) { if(params.get("limit") != null){
limit = Integer.parseInt((String) params.get("limit")); limit = Integer.parseInt((String)params.get("limit"));
} }
// 计算偏移量,并将分页相关参数放入当前对象中
this.put("offset", (currPage - 1) * limit); this.put("offset", (currPage - 1) * limit);
this.put("page", currPage); this.put("page", currPage);
this.put("limit", limit); this.put("limit", limit);
// 防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险 //防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String sidx = SQLFilter.sqlInject((String) params.get("sidx")); String sidx = SQLFilter.sqlInject((String)params.get("sidx"));
String order = SQLFilter.sqlInject((String) params.get("order")); String order = SQLFilter.sqlInject((String)params.get("order"));
this.put("sidx", sidx); this.put("sidx", sidx);
this.put("order", order); this.put("order", order);
// 创建mybatis-plus分页对象 //mybatis-plus分页
this.page = new Page<>(currPage, limit); this.page = new Page<>(currPage, limit);
// 进行排序设置 //排序
if (StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)) { if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx); this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order)); this.page.setAsc("ASC".equalsIgnoreCase(order));
} }
} }
/**
* mybatis-plus
*
* @return mybatis-plusPage
*/
public Page<T> getPage() { public Page<T> getPage() {
return page; return page;
} }
/**
*
*
* @return
*/
public int getCurrPage() { public int getCurrPage() {
return currPage; return currPage;
} }
/**
*
*
* @return
*/
public int getLimit() { public int getLimit() {
return limit; return limit;
} }
} }

@ -4,46 +4,23 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* HashMap<String, Object> *
* WebAPI
*/ */
public class R extends HashMap<String, Object> { public class R extends HashMap<String, Object> {
// 用于实现序列化版本控制,确保不同版本的类在反序列化时的兼容性
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 0
*/
public R() { public R() {
put("code", 0); put("code", 0);
} }
/**
* 500
*
* @return R
*/
public static R error() { public static R error() {
return error(500, "未知异常,请联系管理员"); return error(500, "未知异常,请联系管理员");
} }
/**
* 500msg
*
* @param msg
* @return R
*/
public static R error(String msg) { public static R error(String msg) {
return error(500, msg); return error(500, msg);
} }
/**
* codemsg
*
* @param code
* @param msg
* @return R
*/
public static R error(int code, String msg) { public static R error(int code, String msg) {
R r = new R(); R r = new R();
r.put("code", code); r.put("code", code);
@ -51,49 +28,24 @@ public class R extends HashMap<String, Object> {
return r; return r;
} }
/**
* msg
*
* @param msg
* @return R
*/
public static R ok(String msg) { public static R ok(String msg) {
R r = new R(); R r = new R();
r.put("msg", msg); r.put("msg", msg);
return r; return r;
} }
/**
* Map
*
* @param map Map
* @return R
*/
public static R ok(Map<String, Object> map) { public static R ok(Map<String, Object> map) {
R r = new R(); R r = new R();
r.putAll(map); r.putAll(map);
return r; return r;
} }
/**
* 0
*
* @return R
*/
public static R ok() { public static R ok() {
return new R(); return new R();
} }
/**
* put
* 便r.put("key1", value1).put("key2", value2)
*
* @param key
* @param value
* @return R
*/
public R put(String key, Object value) { public R put(String key, Object value) {
super.put(key, value); super.put(key, value);
return this; return this;
} }
} }

@ -1,3 +1,4 @@
package com.utils; package com.utils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -5,45 +6,37 @@ import org.apache.commons.lang3.StringUtils;
import com.entity.EIException; import com.entity.EIException;
/** /**
* SQLSQL * SQL
* SQL
*/ */
public class SQLFilter { public class SQLFilter {
/** /**
* SQL * SQL
* SQL * @param str
*
* @param str SQL
* @return null
* EIException
*/ */
public static String sqlInject(String str) { public static String sqlInject(String str){
// 检查输入字符串是否为空或只包含空白字符 if(StringUtils.isBlank(str)){
if (StringUtils.isBlank(str)) {
return null; return null;
} }
// 去掉字符串中的单引号、双引号、分号和反斜杠字符这些字符在SQL中可能用于构造恶意语句 //去掉'|"|;|\字符
str = StringUtils.replace(str, "'", ""); str = StringUtils.replace(str, "'", "");
str = StringUtils.replace(str, "\"", ""); str = StringUtils.replace(str, "\"", "");
str = StringUtils.replace(str, ";", ""); str = StringUtils.replace(str, ";", "");
str = StringUtils.replace(str, "\\", ""); str = StringUtils.replace(str, "\\", "");
// 将字符串转换为小写,方便统一检查非法关键字,不区分大小写 //转换成小写
str = str.toLowerCase(); str = str.toLowerCase();
// 定义一个包含常见非法SQL关键字的数组这些关键字可能被用于恶意的SQL操作 //非法字符
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
// 遍历非法关键字数组,检查字符串中是否包含这些关键字 //判断是否包含非法字符
for (String keyword : keywords) { for(String keyword : keywords){
if (str.indexOf(keyword) != -1) { if(str.indexOf(keyword) != -1){
// 如果包含非法关键字则抛出EIException异常提示包含非法字符
throw new EIException("包含非法字符"); throw new EIException("包含非法字符");
} }
} }
// 如果字符串不包含非法字符和关键字,则返回过滤后的字符串
return str; return str;
} }
} }

@ -1,3 +1,4 @@
package com.utils; package com.utils;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
@ -5,78 +6,38 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* Spring Context * Spring Context
* ApplicationContextAware Spring ApplicationContext
* Spring 便 Spring Bean
*/ */
@Component @Component
public class SpringContextUtils implements ApplicationContextAware { public class SpringContextUtils implements ApplicationContextAware {
// 静态的 ApplicationContext 实例,用于存储 Spring 应用上下文 public static ApplicationContext applicationContext;
public static ApplicationContext applicationContext;
/**
* ApplicationContextAware Spring
* ApplicationContext
*
* @param applicationContext Spring
* @throws BeansException ApplicationContext
*/
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException { throws BeansException {
SpringContextUtils.applicationContext = applicationContext; SpringContextUtils.applicationContext = applicationContext;
} }
/**
* Bean Spring Bean
*
* @param name Bean
* @return Bean
*/
public static Object getBean(String name) { public static Object getBean(String name) {
return applicationContext.getBean(name); return applicationContext.getBean(name);
} }
/**
* Bean Spring Bean
*
* @param name Bean
* @param requiredType Bean
* @param <T> Bean
* @return Bean
*/
public static <T> T getBean(String name, Class<T> requiredType) { public static <T> T getBean(String name, Class<T> requiredType) {
return applicationContext.getBean(name, requiredType); return applicationContext.getBean(name, requiredType);
} }
/**
* Spring Bean
*
* @param name Bean
* @return true false
*/
public static boolean containsBean(String name) { public static boolean containsBean(String name) {
return applicationContext.containsBean(name); return applicationContext.containsBean(name);
} }
/**
* Bean
*
* @param name Bean
* @return true false
*/
public static boolean isSingleton(String name) { public static boolean isSingleton(String name) {
return applicationContext.isSingleton(name); return applicationContext.isSingleton(name);
} }
/**
* Bean
*
* @param name Bean
* @return Bean
*/
public static Class<? extends Object> getType(String name) { public static Class<? extends Object> getType(String name) {
return applicationContext.getType(name); return applicationContext.getType(name);
} }
} }

@ -1,5 +1,7 @@
package com.utils; package com.utils;
import java.util.Set; import java.util.Set;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
@ -10,41 +12,28 @@ import com.entity.EIException;
/** /**
* hibernate-validator * hibernate-validator
* Hibernate Validator
* EIException
*/ */
public class ValidatorUtils { public class ValidatorUtils {
// 静态的Validator对象用于执行校验操作。
// 由于Validator是线程安全的使用静态变量可以在整个应用程序中共享同一个实例提高性能。
private static Validator validator; private static Validator validator;
// 静态代码块在类加载时执行确保Validator对象只被初始化一次。
// 通过Validation类构建默认的验证工厂然后从工厂中获取Validator实例。
static { static {
validator = Validation.buildDefaultValidatorFactory().getValidator(); validator = Validation.buildDefaultValidatorFactory().getValidator();
} }
/** /**
* *
* * @param object
* @param object 使Hibernate Validator * @param groups
* @param groups * @throws EIException EIException
* @throws EIException EIException
*
*/ */
public static void validateEntity(Object object, Class<?>... groups) public static void validateEntity(Object object, Class<?>... groups)
throws EIException { throws EIException {
// 调用Validator的validate方法对对象进行校验根据指定的组应用相应的约束条件。
// 该方法会返回一个包含所有违反约束信息的Set集合。
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups); Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups);
// 检查约束违反集合是否为空,若不为空则表示存在校验不通过的情况。
if (!constraintViolations.isEmpty()) { if (!constraintViolations.isEmpty()) {
// 获取集合中的第一个违反约束的信息。 ConstraintViolation<Object> constraint = (ConstraintViolation<Object>)constraintViolations.iterator().next();
// 这里仅取第一个违反约束的信息作为异常信息抛出,可能会忽略其他违反约束的情况。
ConstraintViolation<Object> constraint = (ConstraintViolation<Object>)constraintViolations.iterator().next();
// 抛出EIException异常将违反约束的详细信息作为异常消息。
throw new EIException(constraint.getMessage()); throw new EIException(constraint.getMessage());
} }
} }
} }

@ -1,319 +1,329 @@
<!-- 首页 --> <!-- 首页 -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<!-- 设置字符编码为 UTF-8 --> <meta charset="utf-8">
<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- 设置视口,用于响应式布局,宽度等于设备宽度,初始缩放比例为 1最大缩放比例为 1 --> <title>首页</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link rel="stylesheet" href="./layui/css/layui.css">
<title>首页</title> <link rel="stylesheet" href="./xznstatic/css/common.css"/>
<!-- 引入 layui 的 CSS 样式文件 --> <link rel="stylesheet" href="./xznstatic/css/style.css"/>
<link rel="stylesheet" href="./layui/css/layui.css"> </head>
<!-- 引入自定义的 common.css 样式文件 --> <style type="text/css">
<link rel="stylesheet" href="./xznstatic/css/common.css"/> html, body {
<!-- 引入自定义的 style.css 样式文件 --> height: 100%;
<link rel="stylesheet" href="./xznstatic/css/style.css"/> }
</head> #iframe {
<style type="text/css"> width: 100%;
html, body { margin-top: 50px;
height: 100%; padding-top: 64px;
} }
/* 定义 id 为 iframe 的元素样式,宽度 100%,上边距 50px内边距顶部 64px */ #header {
#iframe { height: auto;
width: 100%; background: #fff;
margin-top: 50px; border-bottom: 0;
padding-top: 64px; position: fixed;
} top: 0;
/* 定义 id 为 header 的元素样式,高度自适应,白色背景,固定定位在顶部,宽度 100%z 轴层级为 1 */ left: 0;
#header { width: 100%;
height: auto; z-index: 1;
background: #fff; }
border-bottom: 0;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}
/* 定义 id 为 header 下的.nav-top 类元素样式,弹性布局,水平居中对齐,设置字体大小、颜色等 */
#header .nav-top {
display: flex;
align-items: center;
padding: 0 20px;
font-size: 16px;
color: #2a8a15;
box-sizing: border-box;
height: 50px;
background: #CB945C;
box-shadow: 0 0px 0px rgba(0, 0, 0,.3);
justify-content: center;
position: relative;
z-index: 1;
}
/* 定义 id 为 header 下的.nav-top-img 类元素样式,设置宽度、高度、边框等 */ #header .nav-top {
#header .nav-top-img { display: flex;
width: 124px; align-items: center;
height: 40px; padding: 0 20px;
padding: 0; font-size: 16px;
margin: 0; color: #2a8a15;
border-radius: 6px; box-sizing: border-box;
border-width: 0; height: 50px;
border-style: solid; background: #CB945C;
border-color: rgba(0, 0, 0,.3); box-shadow: 0 0px 0px rgba(0,0,0,.3);
box-shadow: 0 0 6px rgba(0, 0, 0,.3); justify-content: center;
} position: relative;
z-index: 1;
}
/* 定义 id 为 header 下的.nav-top-title 类元素样式,设置行高、字体大小、颜色、背景等 */ #header .nav-top-img {
#header .nav-top-title { width: 124px;
line-height: 40px; height: 40px;
font-size: 20px; padding: 0;
color: rgba(255, 255, 255, 1); margin: 0;
padding: 0 10px; border-radius: 6px;
margin: 0 10px; border-width: 0;
border-radius: 6px; border-style: solid;
border-width: 0; border-color: rgba(0,0,0,.3);
border-style: solid; box-shadow: 0 0 6px rgba(0,0,0,.3);
border-color: rgba(0, 0, 0,.3); }
background-color: rgba(0, 0, 0, 0);
box-shadow: 0 0 0px rgba(0, 0, 0,.3);
}
/* 定义 id 为 header 下的.nav-top-tel 类元素样式,设置行高、字体大小、颜色、边框等 */ #header .nav-top-title {
#header .nav-top-tel { line-height: 40px;
line-height: 40px; font-size: 20px;
font-size: 16px; color: rgba(255, 255, 255, 1);
color: #333; padding: 0 10px;
padding: 0 10px; margin: 0 10px;
margin: 0; border-radius: 6px;
border-radius: 6px; border-width: 0;
border-width: 0; border-style: solid;
border-style: solid; border-color: rgba(0,0,0,.3);
border-color: rgba(0, 0, 0,.3); background-color: rgba(0,0,0,0);
box-shadow: 0 0 6px rgba(0, 0, 0,.3); box-shadow: 0 0 0px rgba(0,0,0,.3);
} }
/* 定义 id 为 header 下的.navs 类元素样式,弹性布局,设置高度、背景、阴影等 */ #header .nav-top-tel {
#header .navs { line-height: 40px;
display: flex; font-size: 16px;
padding: 0 20px; color: #333;
align-items: center; padding: 0 10px;
box-sizing: border-box; margin: 0;
height: 64px; border-radius: 6px;
background: #F2F2F2; border-width: 0;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0); border-style: solid;
justify-content: center; border-color: rgba(0,0,0,.3);
} box-shadow: 0 0 6px rgba(0,0,0,.3);
/* 定义 id 为 header 下的.navs1 类元素样式,设置宽度、高度、背景、定位等 */ }
#header .navs1 {
width: 200px;
height: 100vh;
background: darkgoldenrod;
position: absolute;
top: 0;
display: block;
padding: 0;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}
/* 隐藏 id 为 header 下的.navs1 类元素的滚动条webkit 内核浏览器) */ #header .navs {
#header .navs.navs1::-webkit-scrollbar { display: flex;
display: none; padding: 0 20px;
} align-items: center;
box-sizing: border-box;
height: 64px;
background: #F2F2F2;
box-shadow: 0 1px 6px rgba(0,0,0,0);
justify-content: center;
}
#header .navs1 {
width: 200px;
height: 100vh;
background: darkgoldenrod;
position: absolute;
top: 0;
display: block;
padding: 0;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}
#header .navs.navs1::-webkit-scrollbar {
display: none;
}
#header .navs1 .list {
display: flex;
flex-direction: column;
}
#header .navs .title {
width: auto;
line-height: 40px;
font-size: 16px;
color: #333;
padding: 0 10px;
margin: 0 5px;
border-radius: 6px;
border-width: 0;
border-style: solid;
border-color: rgba(0,0,0,.3);
background-color: rgba(0,0,0,0);
box-shadow: 0 0 6px rgba(0,0,0,0);
}
#header .navs li {
display: inline-block;
width: auto;
line-height: 34px;
padding: 0 20px;
margin: 0 5px;
color: rgba(0, 0, 0, 1);
font-size: 16px;
border-radius: 10px;
border-width: 10px 0 0;
border-style: solid;
border-color: rgba(143, 143, 143, 1);
background-color: rgba(217, 217, 217, 1);
box-shadow: 0 0 0px rgba(0,0,0,.1);
text-align: center;
box-sizing: border-box;
cursor: pointer;
}
#header .navs li a{
color: inherit;
}
#header .navs li.current a{
color: inherit;
}
#header .navs li a:hover{
color: inherit;
}
#header .navs li.current {
color: rgba(0, 0, 0, 1);
font-size: 16px;
border-radius: 10px;
border-width: 10px 0 0;
border-style: solid;
border-color: rgba(213, 169, 122, 1);
background-color: rgba(223, 195, 153, 1);
box-shadow: 0 0 0px rgba(255,0,0,.8);
}
#header .navs li:hover {
color: rgba(0, 0, 0, 1);
font-size: 16px;
border-radius: 10px;
border-width: 10px 0 0;
border-style: solid;
border-color: rgba(213, 169, 122, 1);
background-color: rgba(223, 195, 153, 1);
box-shadow: 0 0 0px rgba(0,0,0,.3);
}
</style>
<body>
<!-- start 顶部导航栏 -->
<div id="header">
<div v-if='true' class="nav-top">
<img v-if='false' class="nav-top-img" src='http://codegen.caihongy.cn/20220207/32e8fb282bd04ae883c7a780558e97f8.png'>
<div v-if="true" class="nav-top-title">{{projectName}}</div>
<div class="nav-top-tel"></div>
</div>
<div class="navs">
<!-- <div class="logo" style="font-size: 20px;top: 32px;color: #fff;font-weight: bold;margin-left: -200px;width: 240px;" v-text="projectName"></div> -->
<div class="title" v-if="false" v-text="projectName"></div>
<div class="list">
<ul>
<li class='current'><a href="javascript:navPage('./pages/home/home.html')" class="menumain"><i v-if="false" class="layui-icon layui-icon-home"></i>首页</a></li>
<li v-for="(item,index) in indexNav" v-bind:key="index"><a :href="'javascript:navPage(\''+item.url+'\')'" class="menumain" style="cursor: pointer;"><i v-if="false" class="layui-icon" :class="iconArr[index]"></i>{{item.name}}</a></li>
<li><a href="javascript:centerPage();" class="menumain"><i v-if="false" class="layui-icon layui-icon-username"></i>个人中心</a></li>
<li><a :href="adminurl" target="_blank" class="menumain" style="cursor: pointer;"><i v-if="false" class="layui-icon layui-icon-link"></i>后台管理</a></li>
</ul>
</div>
</div>
</div>
<!-- end 顶部导航栏 -->
/* 定义 id 为 header 下的.navs1 类元素下的.list 类元素样式,设置为弹性列布局 */ <iframe src="./pages/home/home.html" id="iframe" frameborder="0" scrolling="no" width="100%" onload="changeFrameHeight"></iframe>
#header .navs1 .list {
display: flex;
flex-direction: column;
}
/* 定义 id 为 header 下的.navs 类元素下的.title 类元素样式,设置行高、字体大小、颜色、边框等 */ <script src="./xznstatic/js/jquery-1.11.3.min.js"></script>
#header .navs .title { <script src="./layui/layui.js"></script>
width: auto; <script src="./js/vue.js"></script>
line-height: 40px; <script src="./js/config.js"></script>
font-size: 16px;
color: #333;
padding: 0 10px;
margin: 0 5px;
border-radius: 6px;
border-width: 0;
border-style: solid;
border-color: rgba(0, 0, 0,.3);
background-color: rgba(0, 0, 0, 0);
box-shadow: 0 0 6px rgba(0, 0, 0, 0);
}
/* 定义 id 为 header 下的.navs 类元素下的 li 元素样式,设置为行内块元素,设置行高、颜色、字体大小、边框等 */ <script>
#header .navs li { var vue1 = new Vue({el: '#tabbar'})
display: inline-block;
width: auto;
line-height: 34px;
padding: 0 20px;
margin: 0 5px;
color: rgba(0, 0, 0, 1);
font-size: 16px;
border-radius: 10px;
border-width: 10px 0 0;
border-style: solid;
border-color: rgba(143, 143, 143, 1);
background-color: rgba(217, 217, 217, 1);
box-shadow: 0 0 0px rgba(0, 0, 0,.1);
text-align: center;
box-sizing: border-box;
cursor: pointer;
}
/* 定义 id 为 header 下的.navs 类元素下的 li 元素内的 a 元素样式,设置颜色继承 */ var vue = new Vue({
#header .navs li a { el: '#header',
color: inherit; data: {
} iconArr: ['layui-icon-gift','layui-icon-email','layui-icon-logout','layui-icon-transfer','layui-icon-slider','layui-icon-print','layui-icon-cols','layui-icon-snowflake','layui-icon-note','layui-icon-flag','layui-icon-theme','layui-icon-website','layui-icon-console','layui-icon-face-surprised','layui-icon-template-1','layui-icon-app','layui-icon-read','layui-icon-component','layui-icon-file-b','layui-icon-unlink','layui-icon-tabs','layui-icon-form','layui-icon-chat'],
indexNav: indexNav,
cartFlag: cartFlag,
adminurl: adminurl,
chatFlag: chatFlag,
projectName: projectName,
},
mounted: function() {
this.bindClickOnLi();
},
created() {
this.iconArr.sort(()=>{
return (0.5-Math.random())
})
},
methods: {
jump(url) {
jump(url)
},
bindClickOnLi() {
let list = document.getElementsByTagName("li");
for(var i = 0;i<list.length;i++){
list[i].onclick = function(){
$(this).addClass("current").siblings().removeClass("current");
localStorage.setItem("checkedLiIndex",$(this).index());
}
}
}
}
});
/* 定义 id 为 header 下的.navs 类元素下的 li 元素带有 current 类时的 a 元素样式,设置颜色继承 */ layui.use(['element','layer'], function() {
#header .navs li.current a { var element = layui.element;
color: inherit; var layer = layui.layer;
} });
/* 定义 id 为 header 下的.navs 类元素下的 li 元素内的 a 元素鼠标悬停时的样式,设置颜色继承 */ function chatTap(){
#header .navs li a:hover { var userTable = localStorage.getItem('userTable');
color: inherit; if (userTable) {
} layui.layer.open({
type: 2,
title: '客服',
area: ['600px', '600px'],
content: './pages/chat/chat.html'
});
} else {
window.location.href = './pages/login/login.html'
}
}
/* 定义 id 为 header 下的.navs 类元素下的 li 元素带有 current 类时的样式,设置颜色、字体大小、边框等 */ // 导航栏跳转
#header .navs li.current { function navPage(url) {
color: rgba(0, 0, 0, 1); localStorage.setItem('iframeUrl', url);
font-size: 16px; document.getElementById('iframe').src = url;
border-radius: 10px; }
border-width: 10px 0 0;
border-style: solid;
border-color: rgba(213, 169, 122, 1);
background-color: rgba(223, 195, 153, 1);
box-shadow: 0 0 0px rgba(255, 0, 0,.8);
}
/* 定义 id 为 header 下的.navs 类元素下的 li 元素鼠标悬停时的样式,设置颜色、字体大小、边框等 */ // 跳转到个人中心也
#header .navs li:hover { function centerPage() {
color: rgba(0, 0, 0, 1); var userTable = localStorage.getItem('userTable');
font-size: 16px; if (userTable) {
border-radius: 10px; localStorage.setItem('iframeUrl', './pages/' + userTable + '/center.html');
border-width: 10px 0 0; document.getElementById('iframe').src = './pages/' + userTable + '/center.html';
border-style: solid; } else {
border-color: rgba(213, 169, 122, 1); window.location.href = './pages/login/login.html'
background-color: rgba(223, 195, 153, 1); }
box-shadow: 0 0 0px rgba(0, 0, 0,.3); }
}
</style>
<body>
<!-- start 顶部导航栏 -->
<div id="header">
<!-- 根据条件 v-if 显示或隐藏.nav-top 类元素 -->
<div v-if='true' class="nav-top">
<!-- 根据条件 v-if 显示或隐藏.nav-top-img 类元素 -->
<img v-if='false' class="nav-top-img" src='http://codegen.caihongy.cn/20220207/32e8fb282bd04ae883c7a780558e97f8.png'>
<!-- 根据条件 v-if 显示或隐藏.nav-top-title 类元素,并绑定 Vue 数据 projectName -->
<div v-if="true" class="nav-top-title">{{projectName}}</div>
<div class="nav-top-tel"></div>
</div>
<div class="navs">
<!-- <div class="logo" style="font-size: 20px;top: 32px;color: #fff;font-weight: bold;margin-left: -200px;width: 240px;" v-text="projectName"></div> -->
<!-- 根据条件 v-if 显示或隐藏.title 类元素,并绑定 Vue 数据 projectName -->
<div class="title" v-if="false" v-text="projectName"></div>
<div class="list">
<ul>
<!-- 带有 current 类的 li 元素,表示当前选中项,点击时调用 navPage 函数跳转到指定页面 -->
<li class='current'><a href="javascript:navPage('./pages/home/home.html')" class="menumain"><i v-if="false" class="layui-icon layui-icon-home"></i>首页</a></li>
<!-- 循环渲染 li 元素,根据 indexNav 数组的数据生成导航项,点击时调用 navPage 函数跳转到指定页面 -->
<li v-for="(item, index) in indexNav" v-bind:key="index"><a :href="'javascript:navPage(\'' + item.url + '\')'" class="menumain" style="cursor: pointer;"><i v-if="false" class="layui-icon" :class="iconArr[index]"></i>{{item.name}}</a></li>
<!-- 点击时调用 centerPage 函数跳转到个人中心页面,根据条件判断是否显示图标 -->
<li><a href="javascript:centerPage();" class="menumain"><i v-if="false" class="layui-icon layui-icon-username"></i>个人中心</a></li>
<!-- 点击时在新窗口打开后台管理页面,根据数据绑定生成 href 属性 -->
<li><a :href="adminurl" target="_blank" class="menumain" style="cursor: pointer;"><i v-if="false" class="layui-icon layui-icon-link"></i>后台管理</a></li>
</ul>
</div>
</div>
</div>
<!-- end 顶部导航栏 -->
<!-- 引入一个 iframe 元素初始加载指定页面id 为 iframe无边框不显示滚动条宽度 100%,加载完成时调用 changeFrameHeight 函数 --> var iframeUrl = localStorage.getItem('iframeUrl');
<iframe src="./pages/home/home.html" id="iframe" frameborder="0" scrolling="no" width="100%" onload="changeFrameHeight"></iframe> document.getElementById('iframe').src = iframeUrl || './pages/home/home.html';
<!-- 引入 jQuery 库文件 --> let list = document.getElementsByTagName("li");
<script src="./xznstatic/js/jquery-1.11.3.min.js"></script> for(var i = 0;i<list.length;i++){
<!-- 引入 layui 的 JavaScript 文件 --> if(i==localStorage.getItem("checkedLiIndex")) {
<script src="./layui/layui.js"></script> $(list[i]).addClass("current").siblings().removeClass("current");
<!-- 引入 Vue 库文件 --> }
<script src="./js/vue.js"></script> }
<!-- 引入自定义的 config.js 文件 -->
<script src="./js/config.js"></script>
<script> // var i = 0;
// 创建一个 Vue 实例,绑定到 id 为 tabbar 的元素上(当前代码中未看到该元素,可能是代码不完整) setInterval(function(){
var vue1 = new Vue({ // i++;
el: '#tabbar' // if(i<50) changeFrameHeight();
}) changeFrameHeight();
},200)
// 创建一个 Vue 实例,绑定到 id 为 header 的元素上 function changeFrameHeight() {
var vue = new Vue({ var iframe = document.getElementById('iframe');
el: '#header', // iframe.height = 'auto';
data: { if (iframe) {
// 图标类名数组,用于循环渲染图标 var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
iconArr: ['layui-icon-gift', 'layui-icon-email', 'layui-icon-logout', 'layui-icon-transfer', 'layui-icon-slider', 'layui-icon-print', 'layui-icon-cols', 'layui-icon-snowflake', 'layui-icon-note', 'layui-icon-flag', 'layui-icon-theme', 'layui-icon-website', 'layui-icon-console', 'layui-icon-face-surprised', 'layui-icon-template-1', 'layui-icon-app', 'layui-icon-read', 'layui-icon-component', 'layui-icon-file-b', 'layui-icon-unlink', 'layui-icon-tabs', 'layui-icon-form', 'layui-icon-chat'], if (iframeWin.document.body) {
// 导航项数据数组,用于循环渲染导航栏的项 iframe.height = iframeWin.document.body.scrollHeight;
indexNav: indexNav, }
// 购物车标志(未看到具体使用逻辑,可能是代码不完整) }
cartFlag: cartFlag, };
// 后台管理页面的 URL
adminurl: adminurl,
// 聊天标志(未看到具体使用逻辑,可能是代码不完整)
chatFlag: chatFlag,
// 项目名称,用于显示在导航栏
projectName: projectName,
},
mounted: function () {
// 页面挂载完成后,调用 bindClickOnLi 方法绑定 li 元素的点击事件
this.bindClickOnLi();
},
created() {
// 在实例创建时,对 iconArr 数组进行随机排序
this.iconArr.sort(() => {
return (0.5 - Math.random())
})
},
methods: {
// 跳转方法,调用外部的 jump 函数(未看到具体实现,可能是代码不完整)
jump(url) {
jump(url)
},
// 绑定 li 元素点击事件的方法,添加或移除 current 类
bindClickOnLi() {
let list = document.getElementsByTagName("li");
for (var i = 0; i < list.length; i++) {
list[i].onclick = function () {
$(this).addClass("current").siblings().removeClass("current");
localStorage.setItem("checkedLiIndex", $(this).index());
}
}
}
}
});
// 加载 layui 的 element 和 layer 模块 // 窗口变化时候iframe自适应
layui.use(['element', 'layer'], function () { // function changeFrameHeight() {
var element = layui.element; // var header = document.getElementById('header').scrollHeight;
var layer = layui.layer; // let isshow = false
}); // var tabbar = 0
// if(isshow) {
// tabbar = document.getElementById('tabbar').scrollHeight
// }
// var ifm = document.getElementById("iframe");
// ifm.height = document.documentElement.clientHeight - header - tabbar;
// ifm.width = document.documentElement.clientWidth;
// }
// 聊天点击事件处理函数,根据用户登录状态决定是打开聊天窗口还是跳转到登录页面 // reasize 事件 窗口大小变化后执行的方法
function chatTap() { window.onresize = function() {
var userTable = localStorage.getItem('userTable'); changeFrameHeight();
if (userTable) { }
layui.layer.open({ </script>
type: 2, </body>
title: '客服', </html>
area: ['600px', '600px'],
content: './pages/chat/chat.html'
});
} else {
window.location.href = './pages/login

@ -1,104 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 定义命名空间,对应 DAO 接口 -->
<mapper namespace="com.dao.CommonDao"> <mapper namespace="com.dao.CommonDao">
<!-- 查询指定列的不重复值,排除空值和空字符串 -->
<!-- 可根据 level 和 parent 条件进行筛选 -->
<select id="getOption" resultType="String" > <select id="getOption" resultType="String" >
<!-- 查询指定表中指定列的不重复值 --> SELECT distinct ${column} FROM ${table}
SELECT distinct ${column} FROM ${table} where ${column} is not null and ${column} !=''
<!-- 排除列值为 null 和空字符串的情况 --> <if test = "level != null">
where ${column} is not null and ${column} !='' and level=#{level}
<!-- 如果 level 参数不为空,添加 level 条件 --> </if>
<if test = "level != null"> <if test = "parent != null">
and level=#{level} and parent=#{parent}
</if> </if>
<!-- 如果 parent 参数不为空,添加 parent 条件 -->
<if test = "parent != null">
and parent=#{parent}
</if>
</select> </select>
<!-- 根据指定列的值查询表中的所有列 -->
<select id="getFollowByOption" resultType="map" > <select id="getFollowByOption" resultType="map" >
<!-- 查询指定表中指定列等于指定值的所有记录 -->
SELECT * FROM ${table} where ${column}=#{columnValue} SELECT * FROM ${table} where ${column}=#{columnValue}
</select> </select>
<!-- 根据 id 更新表中的 sfsh 字段 -->
<update id="sh"> <update id="sh">
<!-- 更新指定表中 id 等于指定值的记录的 sfsh 字段 -->
UPDATE ${table} set sfsh=#{sfsh} where id=#{id} UPDATE ${table} set sfsh=#{sfsh} where id=#{id}
</update> </update>
<!-- 根据不同条件统计记录数量 -->
<select id="remindCount" resultType="int" > <select id="remindCount" resultType="int" >
<!-- 统计指定表中的记录数量 --> SELECT count(1) FROM ${table}
SELECT count(1) FROM ${table} where 1=1
<!-- 基础条件,始终为真 --> <if test = "type == 1 ">
where 1=1 <if test = " remindstart != null ">
<!-- 如果 type 为 1 --> and ${column} &gt;= #{remindstart}
<if test = "type == 1 "> </if>
<!-- 如果 remindstart 参数不为空,添加大于等于条件 --> <if test = " remindend != null ">
<if test = " remindstart != null "> and ${column} &lt;= #{remindend}
and ${column} &gt;= #{remindstart} </if>
</if>
<!-- 如果 remindend 参数不为空,添加小于等于条件 -->
<if test = " remindend != null ">
and ${column} &lt;= #{remindend}
</if> </if>
</if> <if test = "type == 2 ">
<!-- 如果 type 为 2 --> <if test = " remindstart != null ">
<if test = "type == 2 "> and ${column} &gt;= str_to_date(#{remindstart},'%Y-%m-%d')
<!-- 如果 remindstart 参数不为空,添加大于等于日期转换后的条件 --> </if>
<if test = " remindstart != null "> <if test = " remindend != null ">
and ${column} &gt;= str_to_date(#{remindstart},'%Y-%m-%d') and ${column} &lt;= str_to_date(#{remindend},'%Y-%m-%d')
</if>
</if> </if>
<!-- 如果 remindend 参数不为空,添加小于等于日期转换后的条件 -->
<if test = " remindend != null ">
and ${column} &lt;= str_to_date(#{remindend},'%Y-%m-%d')
</if>
</if>
</select> </select>
<!-- 对指定列进行聚合计算,包括求和、最大值、最小值和平均值 -->
<select id="selectCal" resultType="map" > <select id="selectCal" resultType="map" >
<!-- 对指定表中的指定列进行求和、求最大值、求最小值和求平均值 -->
SELECT sum(${column}) sum,max(${column}) max,min(${column}) min,avg(${column}) avg FROM ${table} SELECT sum(${column}) sum,max(${column}) max,min(${column}) min,avg(${column}) avg FROM ${table}
</select> </select>
<!-- 对指定列进行分组统计,统计每组的记录数量 -->
<select id="selectGroup" resultType="map" > <select id="selectGroup" resultType="map" >
<!-- 对指定表中的指定列进行分组,并统计每组的记录数量 -->
SELECT ${column} , count(1) total FROM ${table} group by ${column} SELECT ${column} , count(1) total FROM ${table} group by ${column}
</select> </select>
<!-- 对指定的 x 列和 y 列进行分组统计,统计每组 y 列的总和 -->
<select id="selectValue" resultType="map" > <select id="selectValue" resultType="map" >
<!-- 对指定表中的 x 列进行分组,并统计每组 y 列的总和 -->
SELECT ${xColumn}, sum(${yColumn}) total FROM ${table} group by ${xColumn} SELECT ${xColumn}, sum(${yColumn}) total FROM ${table} group by ${xColumn}
</select> </select>
<!-- 根据不同的时间统计类型对指定的 x 列和 y 列进行分组统计,统计每组 y 列的总和 --> <select id="selectTimeStatValue" resultType="map" >
<select id="selectTimeStatValue" resultType="map" > <if test = 'timeStatType == "日"'>
<!-- 如果时间统计类型为日 --> SELECT DATE_FORMAT(${xColumn},'%Y-%m-%d') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y-%m-%d')
<if test = 'timeStatType == "日"'> </if>
<!-- 按日对指定表中的 x 列进行分组,并统计每组 y 列的总和 --> <if test = 'timeStatType == "月"'>
SELECT DATE_FORMAT(${xColumn},'%Y-%m-%d') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y-%m-%d') SELECT DATE_FORMAT(${xColumn},'%Y-%m') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y-%m')
</if> </if>
<!-- 如果时间统计类型为月 --> <if test = 'timeStatType == "年"'>
<if test = 'timeStatType == "月"'> SELECT DATE_FORMAT(${xColumn},'%Y') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y')
<!-- 按月对指定表中的 x 列进行分组,并统计每组 y 列的总和 --> </if>
SELECT DATE_FORMAT(${xColumn},'%Y-%m') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y-%m') </select>
</if> <select id="getFollowByOption2" resultType="java.lang.String"></select>
<!-- 如果时间统计类型为年 -->
<if test = 'timeStatType == "年"'>
<!-- 按年对指定表中的 x 列进行分组,并统计每组 y 列的总和 -->
SELECT DATE_FORMAT(${xColumn},'%Y') ${xColumn}, sum(${yColumn}) total FROM ${table} group by DATE_FORMAT(${xColumn},'%Y')
</if>
</select>
<!-- 此查询方法未实现具体的 SQL 逻辑 -->
<select id="getFollowByOption2" resultType="java.lang.String"></select>
</mapper> </mapper>

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- 定义 XML 文档的版本和字符编码 -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 引入 MyBatis Mapper 的 DTD 定义,以确保 XML 文件格式符合 MyBatis 的要求 -->
<mapper namespace="com.dao.ConfigDao"> <mapper namespace="com.dao.ConfigDao">
<!-- 定义一个 MyBatis 的 Mapper 命名空间,该命名空间对应一个 DAO 接口,这里是 com.dao.ConfigDao -->
<!-- 后续可以在这个命名空间下定义 SQL 语句映射 -->
</mapper> </mapper>

@ -1,67 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- 声明 XML 文档的版本和字符编码 -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- 引入 MyBatis Mapper 的 DTD 定义,确保 XML 文件符合 MyBatis 的规范 -->
<mapper namespace="com.dao.DiscussjiudianjianjieDao"> <mapper namespace="com.dao.DiscussjiudianjianjieDao">
<!-- 定义 Mapper 的命名空间,对应 DAO 接口 com.dao.DiscussjiudianjianjieDao -->
<!-- 可根据自己的需求,是否要使用 --> <!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.entity.DiscussjiudianjianjieEntity" id="discussjiudianjianjieMap"> <resultMap type="com.entity.DiscussjiudianjianjieEntity" id="discussjiudianjianjieMap">
<!-- 定义一个结果映射,将数据库查询结果映射到 com.entity.DiscussjiudianjianjieEntity 实体类 --> <result property="refid" column="refid"/>
<!-- 映射实体类的 refid 属性到数据库表的 refid 列 --> <result property="userid" column="userid"/>
<result property="refid" column="refid"/> <result property="nickname" column="nickname"/>
<!-- 映射实体类的 userid 属性到数据库表的 userid 列 --> <result property="content" column="content"/>
<result property="userid" column="userid"/> <result property="reply" column="reply"/>
<!-- 映射实体类的 nickname 属性到数据库表的 nickname 列 --> </resultMap>
<result property="nickname" column="nickname"/>
<!-- 映射实体类的 content 属性到数据库表的 content 列 -->
<result property="content" column="content"/>
<!-- 映射实体类的 reply 属性到数据库表的 reply 列 -->
<result property="reply" column="reply"/>
</resultMap>
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.DiscussjiudianjianjieVO"> resultType="com.entity.vo.DiscussjiudianjianjieVO" >
<!-- 定义一个查询语句ID 为 selectListVO用于查询数据列表 --> SELECT * FROM discussjiudianjianjie discussjiudianjianjie
<!-- 查询结果将映射到 com.entity.vo.DiscussjiudianjianjieVO 视图对象 --> <where> 1=1 ${ew.sqlSegment}</where>
SELECT * FROM discussjiudianjianjie discussjiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where>
<!-- 使用 <where> 标签动态生成 WHERE 子句 -->
<!-- 1=1 是一个恒成立的条件,方便后续拼接其他条件 -->
<!-- ${ew.sqlSegment} 是动态 SQL 片段,可根据具体情况拼接查询条件 -->
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.DiscussjiudianjianjieVO"> resultType="com.entity.vo.DiscussjiudianjianjieVO" >
<!-- 定义一个查询语句ID 为 selectVO用于查询单个数据 --> SELECT discussjiudianjianjie.* FROM discussjiudianjianjie discussjiudianjianjie
<!-- 查询结果将映射到 com.entity.vo.DiscussjiudianjianjieVO 视图对象 --> <where> 1=1 ${ew.sqlSegment}</where>
SELECT discussjiudianjianjie.* FROM discussjiudianjianjie discussjiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where>
<!-- 使用 <where> 标签动态生成 WHERE 子句 -->
<!-- 1=1 是一个恒成立的条件,方便后续拼接其他条件 -->
<!-- ${ew.sqlSegment} 是动态 SQL 片段,可根据具体情况拼接查询条件 -->
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.DiscussjiudianjianjieView"> resultType="com.entity.view.DiscussjiudianjianjieView" >
<!-- 定义一个查询语句ID 为 selectListView用于查询数据列表 -->
<!-- 查询结果将映射到 com.entity.view.DiscussjiudianjianjieView 视图对象 -->
SELECT discussjiudianjianjie.* FROM discussjiudianjianjie discussjiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where>
<!-- 使用 <where> 标签动态生成 WHERE 子句 -->
<!-- 1=1 是一个恒成立的条件,方便后续拼接其他条件 -->
<!-- ${ew.sqlSegment} 是动态 SQL 片段,可根据具体情况拼接查询条件 -->
</select>
SELECT discussjiudianjianjie.* FROM discussjiudianjianjie discussjiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where>
</select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.DiscussjiudianjianjieView"> resultType="com.entity.view.DiscussjiudianjianjieView" >
<!-- 定义一个查询语句ID 为 selectView用于查询单个数据 -->
<!-- 查询结果将映射到 com.entity.view.DiscussjiudianjianjieView 视图对象 -->
SELECT * FROM discussjiudianjianjie discussjiudianjianjie <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM discussjiudianjianjie discussjiudianjianjie <where> 1=1 ${ew.sqlSegment}</where>
<!-- 使用 <where> 标签动态生成 WHERE 子句 -->
<!-- 1=1 是一个恒成立的条件,方便后续拼接其他条件 -->
<!-- ${ew.sqlSegment} 是动态 SQL 片段,可根据具体情况拼接查询条件 -->
</select> </select>
</mapper> </mapper>

@ -14,27 +14,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.DiscussjiudiankefangVO" > resultType="com.entity.vo.DiscussjiudiankefangVO" >
SELECT * FROM discussjiudiankefang discussjiudiankefang SELECT * FROM discussjiudiankefang discussjiudiankefang
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.DiscussjiudiankefangVO" > resultType="com.entity.vo.DiscussjiudiankefangVO" >
SELECT discussjiudiankefang.* FROM discussjiudiankefang discussjiudiankefang SELECT discussjiudiankefang.* FROM discussjiudiankefang discussjiudiankefang
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.DiscussjiudiankefangView" > resultType="com.entity.view.DiscussjiudiankefangView" >
SELECT discussjiudiankefang.* FROM discussjiudiankefang discussjiudiankefang SELECT discussjiudiankefang.* FROM discussjiudiankefang discussjiudiankefang
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.DiscussjiudiankefangView" > resultType="com.entity.view.DiscussjiudiankefangView" >
SELECT * FROM discussjiudiankefang discussjiudiankefang <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM discussjiudiankefang discussjiudiankefang <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

@ -16,27 +16,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.JiudianjianjieVO" > resultType="com.entity.vo.JiudianjianjieVO" >
SELECT * FROM jiudianjianjie jiudianjianjie SELECT * FROM jiudianjianjie jiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.JiudianjianjieVO" > resultType="com.entity.vo.JiudianjianjieVO" >
SELECT jiudianjianjie.* FROM jiudianjianjie jiudianjianjie SELECT jiudianjianjie.* FROM jiudianjianjie jiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.JiudianjianjieView" > resultType="com.entity.view.JiudianjianjieView" >
SELECT jiudianjianjie.* FROM jiudianjianjie jiudianjianjie SELECT jiudianjianjie.* FROM jiudianjianjie jiudianjianjie
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.JiudianjianjieView" > resultType="com.entity.view.JiudianjianjieView" >
SELECT * FROM jiudianjianjie jiudianjianjie <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM jiudianjianjie jiudianjianjie <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

@ -10,27 +10,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.KefangleixingVO" > resultType="com.entity.vo.KefangleixingVO" >
SELECT * FROM kefangleixing kefangleixing SELECT * FROM kefangleixing kefangleixing
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.KefangleixingVO" > resultType="com.entity.vo.KefangleixingVO" >
SELECT kefangleixing.* FROM kefangleixing kefangleixing SELECT kefangleixing.* FROM kefangleixing kefangleixing
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.KefangleixingView" > resultType="com.entity.view.KefangleixingView" >
SELECT kefangleixing.* FROM kefangleixing kefangleixing SELECT kefangleixing.* FROM kefangleixing kefangleixing
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.KefangleixingView" > resultType="com.entity.view.KefangleixingView" >
SELECT * FROM kefangleixing kefangleixing <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM kefangleixing kefangleixing <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

@ -23,27 +23,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.KefangyudingVO" > resultType="com.entity.vo.KefangyudingVO" >
SELECT * FROM kefangyuding kefangyuding SELECT * FROM kefangyuding kefangyuding
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.KefangyudingVO" > resultType="com.entity.vo.KefangyudingVO" >
SELECT kefangyuding.* FROM kefangyuding kefangyuding SELECT kefangyuding.* FROM kefangyuding kefangyuding
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.KefangyudingView" > resultType="com.entity.view.KefangyudingView" >
SELECT kefangyuding.* FROM kefangyuding kefangyuding SELECT kefangyuding.* FROM kefangyuding kefangyuding
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.KefangyudingView" > resultType="com.entity.view.KefangyudingView" >
SELECT * FROM kefangyuding kefangyuding <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM kefangyuding kefangyuding <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

@ -13,27 +13,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.NewsVO" > resultType="com.entity.vo.NewsVO" >
SELECT * FROM news news SELECT * FROM news news
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.NewsVO" > resultType="com.entity.vo.NewsVO" >
SELECT news.* FROM news news SELECT news.* FROM news news
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.NewsView" > resultType="com.entity.view.NewsView" >
SELECT news.* FROM news news SELECT news.* FROM news news
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.NewsView" > resultType="com.entity.view.NewsView" >
SELECT * FROM news news <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM news news <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

@ -20,27 +20,27 @@
<select id="selectListVO" <select id="selectListVO"
resultType="com.entity.vo.RuzhuanpaiVO" > resultType="com.entity.vo.RuzhuanpaiVO" >
SELECT * FROM ruzhuanpai ruzhuanpai SELECT * FROM ruzhuanpai ruzhuanpai
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectVO" <select id="selectVO"
resultType="com.entity.vo.RuzhuanpaiVO" > resultType="com.entity.vo.RuzhuanpaiVO" >
SELECT ruzhuanpai.* FROM ruzhuanpai ruzhuanpai SELECT ruzhuanpai.* FROM ruzhuanpai ruzhuanpai
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectListView" <select id="selectListView"
resultType="com.entity.view.RuzhuanpaiView" > resultType="com.entity.view.RuzhuanpaiView" >
SELECT ruzhuanpai.* FROM ruzhuanpai ruzhuanpai SELECT ruzhuanpai.* FROM ruzhuanpai ruzhuanpai
<where> 1=1 ${ew.sqlSegment}</where> <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
<select id="selectView" <select id="selectView"
resultType="com.entity.view.RuzhuanpaiView" > resultType="com.entity.view.RuzhuanpaiView" >
SELECT * FROM ruzhuanpai ruzhuanpai <where> 1=1 ${ew.sqlSegment}</where> SELECT * FROM ruzhuanpai ruzhuanpai <where> 1=1 ${ew.sqlSegment}</where>
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save