已修改2个文件
已重命名20个文件
已删除1个文件
已添加1个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * Mybatis Plus é
ç½® |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @EnableTransactionManagement(proxyTargetClass = true) |
| | | @Configuration |
| | | public class MybatisPlusConfig |
| | | { |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() |
| | | { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | // å页æä»¶ |
| | | interceptor.addInnerInterceptor(paginationInnerInterceptor()); |
| | | // ä¹è§éæä»¶ |
| | | interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); |
| | | // 黿æä»¶ |
| | | interceptor.addInnerInterceptor(blockAttackInnerInterceptor()); |
| | | return interceptor; |
| | | } |
| | | |
| | | /** |
| | | * å页æä»¶ï¼èªå¨è¯å«æ°æ®åºç±»å https://baomidou.com/guide/interceptor-pagination.html |
| | | */ |
| | | public PaginationInnerInterceptor paginationInnerInterceptor() |
| | | { |
| | | PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); |
| | | // è®¾ç½®æ°æ®åºç±»å为mysql |
| | | paginationInnerInterceptor.setDbType(DbType.MYSQL); |
| | | // 设置æå¤§å页éå¶æ°éï¼é»è®¤ 500 æ¡ï¼-1 ä¸åéå¶ |
| | | paginationInnerInterceptor.setMaxLimit(-1L); |
| | | return paginationInnerInterceptor; |
| | | } |
| | | |
| | | /** |
| | | * ä¹è§éæä»¶ https://baomidou.com/guide/interceptor-optimistic-locker.html |
| | | */ |
| | | public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() |
| | | { |
| | | return new OptimisticLockerInnerInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 妿æ¯å¯¹å
¨è¡¨çå é¤ææ´æ°æä½ï¼å°±ä¼ç»æ¢è¯¥æä½ https://baomidou.com/guide/interceptor-block-attack.html |
| | | */ |
| | | public BlockAttackInnerInterceptor blockAttackInnerInterceptor() |
| | | { |
| | | return new BlockAttackInnerInterceptor(); |
| | | } |
| | | } |
| | |
| | | druid:
|
| | | # ä¸»åºæ°æ®æº
|
| | | master:
|
| | | url: jdbc:mysql://114.132.189.42:9004/product-inventory-management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
| | | username: root
|
| | | password: 123456
|
| | | # ä»åºæ°æ®æº
|
| | |
| | | wall:
|
| | | config:
|
| | | multi-statement-allow: true
|
| | |
|
| | | # mybatis-plusé
ç½®
|
| | | mybatis-plus:
|
| | | mapper-locations: classpath*:mapper/**/*Mapper.xml
|
| | | type-aliases-package: com.ruoyi.**.domain
|
| | | global-config:
|
| | | banner: off
|
| | | db-config:
|
| | | id-type: auto
|
| | | configuration:
|
| | | map-underscore-to-camel-case: true
|
| | | cache-enabled: false
|
| | | log-impl: # org.apache.ibatis.logging.stdout.StdOutImpl |
| | |
| | | # ä»¤çæææï¼é»è®¤30åéï¼
|
| | | expireTime: 30
|
| | |
|
| | | # MyBatisé
ç½®
|
| | | mybatis:
|
| | | # æç´¢æå®å
å«å
|
| | | typeAliasesPackage: com.ruoyi.project.**.domain
|
| | | # MyBatis Plusé
ç½® |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.basic.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶
|
| | | mapperLocations: classpath*:mybatis/**/*Mapper.xml
|
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶
|
| | | configLocation: classpath:mybatis/mybatis-config.xml
|
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | |
|
| | | # PageHelperå页æä»¶
|
| | | pagehelper:
|
ÎļþÃû´Ó src/main/resources/mybatis/monitor/SysLogininforMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.monitor.mapper.SysLogininforMapper">
|
| | |
|
| | | <resultMap type="SysLogininfor" id="SysLogininforResult">
|
| | | <resultMap type="com.ruoyi.project.monitor.domain.SysLogininfor" id="SysLogininforResult"> |
| | | <id property="infoId" column="info_id" />
|
| | | <result property="userName" column="user_name" />
|
| | | <result property="status" column="status" />
|
| | |
| | | <result property="loginTime" column="login_time" />
|
| | | </resultMap>
|
| | |
|
| | | <insert id="insertLogininfor" parameterType="SysLogininfor">
|
| | | <insert id="insertLogininfor" parameterType="com.ruoyi.project.monitor.domain.SysLogininfor"> |
| | | insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
| | | values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
|
| | | </insert>
|
| | |
|
| | | <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
| | | <select id="selectLogininforList" parameterType="com.ruoyi.project.monitor.domain.SysLogininfor" resultMap="SysLogininforResult"> |
| | | select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
|
| | | <where>
|
| | | <if test="ipaddr != null and ipaddr != ''">
|
ÎļþÃû´Ó src/main/resources/mybatis/monitor/SysOperLogMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.monitor.mapper.SysOperLogMapper">
|
| | |
|
| | | <resultMap type="SysOperLog" id="SysOperLogResult">
|
| | | <resultMap type="com.ruoyi.project.monitor.domain.SysOperLog" id="SysOperLogResult"> |
| | | <id property="operId" column="oper_id" />
|
| | | <result property="title" column="title" />
|
| | | <result property="businessType" column="business_type" />
|
| | |
| | | from sys_oper_log
|
| | | </sql>
|
| | |
|
| | | <insert id="insertOperlog" parameterType="SysOperLog">
|
| | | <insert id="insertOperlog" parameterType="com.ruoyi.project.monitor.domain.SysOperLog"> |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
| | | </insert>
|
| | |
|
| | | <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
| | | <select id="selectOperLogList" parameterType="com.ruoyi.project.monitor.domain.SysOperLog" resultMap="SysOperLogResult"> |
| | | <include refid="selectOperLogVo"/>
|
| | | <where>
|
| | | <if test="operIp != null and operIp != ''">
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysConfigMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysConfigMapper">
|
| | |
|
| | | <resultMap type="SysConfig" id="SysConfigResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysConfig" id="SysConfigResult"> |
| | | <id property="configId" column="config_id" />
|
| | | <result property="configName" column="config_name" />
|
| | | <result property="configKey" column="config_key" />
|
| | |
| | | </where>
|
| | | </sql>
|
| | |
|
| | | <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
| | | <select id="selectConfig" parameterType="com.ruoyi.project.system.domain.SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/>
|
| | | <include refid="sqlwhereSearch"/>
|
| | | </select>
|
| | |
|
| | | <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
| | | <select id="selectConfigList" parameterType="com.ruoyi.project.system.domain.SysConfig" resultMap="SysConfigResult"> |
| | | <include refid="selectConfigVo"/>
|
| | | <where>
|
| | | <if test="configName != null and configName != ''">
|
| | |
| | | where config_key = #{configKey} limit 1
|
| | | </select>
|
| | |
|
| | | <insert id="insertConfig" parameterType="SysConfig">
|
| | | <insert id="insertConfig" parameterType="com.ruoyi.project.system.domain.SysConfig"> |
| | | insert into sys_config (
|
| | | <if test="configName != null and configName != '' ">config_name,</if>
|
| | | <if test="configKey != null and configKey != '' ">config_key,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateConfig" parameterType="SysConfig">
|
| | | <update id="updateConfig" parameterType="com.ruoyi.project.system.domain.SysConfig"> |
| | | update sys_config
|
| | | <set>
|
| | | <if test="configName != null and configName != ''">config_name = #{configName},</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysDeptMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysDeptMapper">
|
| | |
|
| | | <resultMap type="SysDept" id="SysDeptResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysDept" id="SysDeptResult"> |
| | | <id property="deptId" column="dept_id" />
|
| | | <result property="parentId" column="parent_id" />
|
| | | <result property="ancestors" column="ancestors" />
|
| | |
| | | from sys_dept d
|
| | | </sql>
|
| | |
|
| | | <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
| | | <select id="selectDeptList" parameterType="com.ruoyi.project.system.domain.SysDept" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/>
|
| | | where d.del_flag = '0'
|
| | | <if test="deptId != null and deptId != 0">
|
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
| | | </select>
|
| | |
|
| | | <insert id="insertDept" parameterType="SysDept">
|
| | | <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | insert into sys_dept(
|
| | | <if test="deptId != null and deptId != 0">dept_id,</if>
|
| | | <if test="parentId != null and parentId != 0">parent_id,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateDept" parameterType="SysDept">
|
| | | <update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | update sys_dept
|
| | | <set>
|
| | | <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysDictDataMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysDictDataMapper">
|
| | |
|
| | | <resultMap type="SysDictData" id="SysDictDataResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysDictData" id="SysDictDataResult"> |
| | | <id property="dictCode" column="dict_code" />
|
| | | <result property="dictSort" column="dict_sort" />
|
| | | <result property="dictLabel" column="dict_label" />
|
| | |
| | | from sys_dict_data
|
| | | </sql>
|
| | |
|
| | | <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
| | | <select id="selectDictDataList" parameterType="com.ruoyi.project.system.domain.SysDictData" resultMap="SysDictDataResult"> |
| | | <include refid="selectDictDataVo"/>
|
| | | <where>
|
| | | <if test="dictType != null and dictType != ''">
|
| | |
| | | </foreach>
|
| | | </delete>
|
| | |
|
| | | <update id="updateDictData" parameterType="SysDictData">
|
| | | <update id="updateDictData" parameterType="com.ruoyi.project.system.domain.SysDictData"> |
| | | update sys_dict_data
|
| | | <set>
|
| | | <if test="dictSort != null">dict_sort = #{dictSort},</if>
|
| | |
| | | update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
| | | </update>
|
| | |
|
| | | <insert id="insertDictData" parameterType="SysDictData">
|
| | | <insert id="insertDictData" parameterType="com.ruoyi.project.system.domain.SysDictData"> |
| | | insert into sys_dict_data(
|
| | | <if test="dictSort != null">dict_sort,</if>
|
| | | <if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysDictTypeMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysDictTypeMapper">
|
| | |
|
| | | <resultMap type="SysDictType" id="SysDictTypeResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysDictType" id="SysDictTypeResult"> |
| | | <id property="dictId" column="dict_id" />
|
| | | <result property="dictName" column="dict_name" />
|
| | | <result property="dictType" column="dict_type" />
|
| | |
| | | from sys_dict_type
|
| | | </sql>
|
| | |
|
| | | <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
| | | <select id="selectDictTypeList" parameterType="com.ruoyi.project.system.domain.SysDictType" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/>
|
| | | <where>
|
| | | <if test="dictName != null and dictName != ''">
|
| | |
| | | </foreach>
|
| | | </delete>
|
| | |
|
| | | <update id="updateDictType" parameterType="SysDictType">
|
| | | <update id="updateDictType" parameterType="com.ruoyi.project.system.domain.SysDictType"> |
| | | update sys_dict_type
|
| | | <set>
|
| | | <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
| | |
| | | where dict_id = #{dictId}
|
| | | </update>
|
| | |
|
| | | <insert id="insertDictType" parameterType="SysDictType">
|
| | | <insert id="insertDictType" parameterType="com.ruoyi.project.system.domain.SysDictType"> |
| | | insert into sys_dict_type(
|
| | | <if test="dictName != null and dictName != ''">dict_name,</if>
|
| | | <if test="dictType != null and dictType != ''">dict_type,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysJobLogMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.monitor.mapper.SysJobLogMapper">
|
| | |
|
| | | <resultMap type="SysJobLog" id="SysJobLogResult">
|
| | | <resultMap type="com.ruoyi.project.monitor.domain.SysJobLog" id="SysJobLogResult"> |
| | | <id property="jobLogId" column="job_log_id" />
|
| | | <result property="jobName" column="job_name" />
|
| | | <result property="jobGroup" column="job_group" />
|
| | |
| | | from sys_job_log
|
| | | </sql>
|
| | |
|
| | | <select id="selectJobLogList" parameterType="SysJobLog" resultMap="SysJobLogResult">
|
| | | <select id="selectJobLogList" parameterType="com.ruoyi.project.monitor.domain.SysJobLog" resultMap="SysJobLogResult"> |
| | | <include refid="selectJobLogVo"/>
|
| | | <where>
|
| | | <if test="jobName != null and jobName != ''">
|
| | |
| | | truncate table sys_job_log
|
| | | </update>
|
| | |
|
| | | <insert id="insertJobLog" parameterType="SysJobLog">
|
| | | <insert id="insertJobLog" parameterType="com.ruoyi.project.monitor.domain.SysJobLog"> |
| | | insert into sys_job_log(
|
| | | <if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
|
| | | <if test="jobName != null and jobName != ''">job_name,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysJobMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.monitor.mapper.SysJobMapper">
|
| | |
|
| | | <resultMap type="SysJob" id="SysJobResult">
|
| | | <resultMap type="com.ruoyi.project.monitor.domain.SysJob" id="SysJobResult"> |
| | | <id property="jobId" column="job_id" />
|
| | | <result property="jobName" column="job_name" />
|
| | | <result property="jobGroup" column="job_group" />
|
| | |
| | | from sys_job
|
| | | </sql>
|
| | |
|
| | | <select id="selectJobList" parameterType="SysJob" resultMap="SysJobResult">
|
| | | <select id="selectJobList" parameterType="com.ruoyi.project.monitor.domain.SysJob" resultMap="SysJobResult"> |
| | | <include refid="selectJobVo"/>
|
| | | <where>
|
| | | <if test="jobName != null and jobName != ''">
|
| | |
| | | </foreach>
|
| | | </delete>
|
| | |
|
| | | <update id="updateJob" parameterType="SysJob">
|
| | | <update id="updateJob" parameterType="com.ruoyi.project.monitor.domain.SysJob"> |
| | | update sys_job
|
| | | <set>
|
| | | <if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
|
| | |
| | | where job_id = #{jobId}
|
| | | </update>
|
| | |
|
| | | <insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId">
|
| | | <insert id="insertJob" parameterType="com.ruoyi.project.monitor.domain.SysJob" useGeneratedKeys="true" keyProperty="jobId"> |
| | | insert into sys_job(
|
| | | <if test="jobId != null and jobId != 0">job_id,</if>
|
| | | <if test="jobName != null and jobName != ''">job_name,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysMenuMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysMenuMapper">
|
| | |
|
| | | <resultMap type="SysMenu" id="SysMenuResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysMenu" id="SysMenuResult"> |
| | | <id property="menuId" column="menu_id" />
|
| | | <result property="menuName" column="menu_name" />
|
| | | <result property="parentName" column="parent_name" />
|
| | |
| | | from sys_menu
|
| | | </sql>
|
| | |
|
| | | <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
| | | <select id="selectMenuList" parameterType="com.ruoyi.project.system.domain.SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/>
|
| | | <where>
|
| | | <if test="menuName != null and menuName != ''">
|
| | |
| | | order by m.parent_id, m.order_num
|
| | | </select>
|
| | |
|
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
| | | <select id="selectMenuListByUserId" parameterType="com.ruoyi.project.system.domain.SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m
|
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id
|
| | |
| | | select count(1) from sys_menu where parent_id = #{menuId}
|
| | | </select>
|
| | |
|
| | | <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
| | | <select id="checkMenuNameUnique" parameterType="com.ruoyi.project.system.domain.SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/>
|
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
| | | </select>
|
| | |
|
| | | <update id="updateMenu" parameterType="SysMenu">
|
| | | <update id="updateMenu" parameterType="com.ruoyi.project.system.domain.SysMenu"> |
| | | update sys_menu
|
| | | <set>
|
| | | <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
| | |
| | | where menu_id = #{menuId}
|
| | | </update>
|
| | |
|
| | | <insert id="insertMenu" parameterType="SysMenu">
|
| | | <insert id="insertMenu" parameterType="com.ruoyi.project.system.domain.SysMenu"> |
| | | insert into sys_menu(
|
| | | <if test="menuId != null and menuId != 0">menu_id,</if>
|
| | | <if test="parentId != null and parentId != 0">parent_id,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysNoticeMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysNoticeMapper">
|
| | |
|
| | | <resultMap type="SysNotice" id="SysNoticeResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysNotice" id="SysNoticeResult"> |
| | | <result property="noticeId" column="notice_id" />
|
| | | <result property="noticeTitle" column="notice_title" />
|
| | | <result property="noticeType" column="notice_type" />
|
| | |
| | | where notice_id = #{noticeId}
|
| | | </select>
|
| | |
|
| | | <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
| | | <select id="selectNoticeList" parameterType="com.ruoyi.project.system.domain.SysNotice" resultMap="SysNoticeResult"> |
| | | <include refid="selectNoticeVo"/>
|
| | | <where>
|
| | | <if test="noticeTitle != null and noticeTitle != ''">
|
| | |
| | | </where>
|
| | | </select>
|
| | |
|
| | | <insert id="insertNotice" parameterType="SysNotice">
|
| | | <insert id="insertNotice" parameterType="com.ruoyi.project.system.domain.SysNotice"> |
| | | insert into sys_notice (
|
| | | <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
| | | <if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateNotice" parameterType="SysNotice">
|
| | | <update id="updateNotice" parameterType="com.ruoyi.project.system.domain.SysNotice"> |
| | | update sys_notice
|
| | | <set>
|
| | | <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysPostMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysPostMapper">
|
| | |
|
| | | <resultMap type="SysPost" id="SysPostResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysPost" id="SysPostResult"> |
| | | <id property="postId" column="post_id" />
|
| | | <result property="postCode" column="post_code" />
|
| | | <result property="postName" column="post_name" />
|
| | |
| | | from sys_post
|
| | | </sql>
|
| | |
|
| | | <select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
| | | <select id="selectPostList" parameterType="com.ruoyi.project.system.domain.SysPost" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/>
|
| | | <where>
|
| | | <if test="postCode != null and postCode != ''">
|
| | |
| | | where post_code=#{postCode} limit 1
|
| | | </select>
|
| | |
|
| | | <update id="updatePost" parameterType="SysPost">
|
| | | <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost"> |
| | | update sys_post
|
| | | <set>
|
| | | <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
| | |
| | | where post_id = #{postId}
|
| | | </update>
|
| | |
|
| | | <insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
| | | <insert id="insertPost" parameterType="com.ruoyi.project.system.domain.SysPost" useGeneratedKeys="true" keyProperty="postId"> |
| | | insert into sys_post(
|
| | | <if test="postId != null and postId != 0">post_id,</if>
|
| | | <if test="postCode != null and postCode != ''">post_code,</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysRoleDeptMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysRoleDeptMapper">
|
| | |
|
| | | <resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysRoleDept" id="SysRoleDeptResult"> |
| | | <result property="roleId" column="role_id" />
|
| | | <result property="deptId" column="dept_id" />
|
| | | </resultMap>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysRoleMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysRoleMapper">
|
| | |
|
| | | <resultMap type="SysRole" id="SysRoleResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysRole" id="SysRoleResult"> |
| | | <id property="roleId" column="role_id" />
|
| | | <result property="roleName" column="role_name" />
|
| | | <result property="roleKey" column="role_key" />
|
| | |
| | | left join sys_dept d on u.dept_id = d.dept_id
|
| | | </sql>
|
| | |
|
| | | <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
| | | <select id="selectRoleList" parameterType="com.ruoyi.project.system.domain.SysRole" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/>
|
| | | where r.del_flag = '0'
|
| | | <if test="roleId != null and roleId != 0">
|
| | |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
| | | </select>
|
| | |
|
| | | <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
| | | <insert id="insertRole" parameterType="com.ruoyi.project.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | insert into sys_role(
|
| | | <if test="roleId != null and roleId != 0">role_id,</if>
|
| | | <if test="roleName != null and roleName != ''">role_name,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateRole" parameterType="SysRole">
|
| | | <update id="updateRole" parameterType="com.ruoyi.project.system.domain.SysRole"> |
| | | update sys_role
|
| | | <set>
|
| | | <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysRoleMenuMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysRoleMenuMapper">
|
| | |
|
| | | <resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysRoleMenu" id="SysRoleMenuResult"> |
| | | <result property="roleId" column="role_id" />
|
| | | <result property="menuId" column="menu_id" />
|
| | | </resultMap>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysUserMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysUserMapper">
|
| | |
|
| | | <resultMap type="SysUser" id="SysUserResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" />
|
| | | <result property="deptId" column="dept_id" />
|
| | | <result property="userName" column="user_name" />
|
| | |
| | | <result property="updateBy" column="update_by" />
|
| | | <result property="updateTime" column="update_time" />
|
| | | <result property="remark" column="remark" />
|
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" />
|
| | | <association property="dept" javaType="com.ruoyi.project.system.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="deptResult" type="SysDept">
|
| | | <resultMap id="deptResult" type="com.ruoyi.project.system.domain.SysDept"> |
| | | <id property="deptId" column="dept_id" />
|
| | | <result property="parentId" column="parent_id" />
|
| | | <result property="deptName" column="dept_name" />
|
| | |
| | | <result property="status" column="dept_status" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="RoleResult" type="SysRole">
|
| | | <resultMap id="RoleResult" type="com.ruoyi.project.system.domain.SysRole"> |
| | | <id property="roleId" column="role_id" />
|
| | | <result property="roleName" column="role_name" />
|
| | | <result property="roleKey" column="role_key" />
|
| | |
| | | left join sys_role r on r.role_id = ur.role_id
|
| | | </sql>
|
| | |
|
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
| | | <select id="selectUserList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
| | | left join sys_dept d on u.dept_id = d.dept_id
|
| | | where u.del_flag = '0'
|
| | |
| | | ${params.dataScope}
|
| | | </select>
|
| | |
|
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
| | | <select id="selectAllocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
| | | from sys_user u
|
| | | left join sys_dept d on u.dept_id = d.dept_id
|
| | |
| | | ${params.dataScope}
|
| | | </select>
|
| | |
|
| | | <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
| | | <select id="selectUnallocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
| | | from sys_user u
|
| | | left join sys_dept d on u.dept_id = d.dept_id
|
| | |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
| | | </select>
|
| | |
|
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
| | | <insert id="insertUser" parameterType="com.ruoyi.project.system.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user(
|
| | | <if test="userId != null and userId != 0">user_id,</if>
|
| | | <if test="deptId != null and deptId != 0">dept_id,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateUser" parameterType="SysUser">
|
| | | <update id="updateUser" parameterType="com.ruoyi.project.system.domain.SysUser"> |
| | | update sys_user
|
| | | <set>
|
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
| | |
| | | where user_id = #{userId}
|
| | | </update>
|
| | |
|
| | | <update id="updateUserStatus" parameterType="SysUser">
|
| | | <update id="updateUserStatus" parameterType="com.ruoyi.project.system.domain.SysUser"> |
| | | update sys_user set status = #{status} where user_id = #{userId}
|
| | | </update>
|
| | |
|
| | | <update id="updateUserAvatar" parameterType="SysUser">
|
| | | <update id="updateUserAvatar" parameterType="com.ruoyi.project.system.domain.SysUser"> |
| | | update sys_user set avatar = #{avatar} where user_name = #{userName}
|
| | | </update>
|
| | |
|
| | | <update id="resetUserPwd" parameterType="SysUser">
|
| | | <update id="resetUserPwd" parameterType="com.ruoyi.project.system.domain.SysUser"> |
| | | update sys_user set password = #{password} where user_name = #{userName}
|
| | | </update>
|
| | |
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysUserPostMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysUserPostMapper">
|
| | |
|
| | | <resultMap type="SysUserPost" id="SysUserPostResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysUserPost" id="SysUserPostResult"> |
| | | <result property="userId" column="user_id" />
|
| | | <result property="postId" column="post_id" />
|
| | | </resultMap>
|
ÎļþÃû´Ó src/main/resources/mybatis/system/SysUserRoleMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysUserRoleMapper">
|
| | |
|
| | | <resultMap type="SysUserRole" id="SysUserRoleResult">
|
| | | <resultMap type="com.ruoyi.project.system.domain.SysUserRole" id="SysUserRoleResult"> |
| | | <result property="userId" column="user_id" />
|
| | | <result property="roleId" column="role_id" />
|
| | | </resultMap>
|
| | |
| | | </foreach>
|
| | | </insert>
|
| | |
|
| | | <delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
| | | <delete id="deleteUserRoleInfo" parameterType="com.ruoyi.project.system.domain.SysUserRole"> |
| | | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
| | | </delete>
|
| | |
|
ÎļþÃû´Ó src/main/resources/mybatis/tool/GenTableColumnMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper">
|
| | |
|
| | | <resultMap type="GenTableColumn" id="GenTableColumnResult">
|
| | | <resultMap type="com.ruoyi.project.tool.gen.domain.GenTableColumn" id="GenTableColumnResult"> |
| | | <id property="columnId" column="column_id" />
|
| | | <result property="tableId" column="table_id" />
|
| | | <result property="columnName" column="column_name" />
|
| | |
| | | order by ordinal_position
|
| | | </select>
|
| | |
|
| | | <insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
|
| | | <insert id="insertGenTableColumn" parameterType="com.ruoyi.project.tool.gen.domain.GenTableColumn" useGeneratedKeys="true" keyProperty="columnId"> |
| | | insert into gen_table_column (
|
| | | <if test="tableId != null and tableId != ''">table_id,</if>
|
| | | <if test="columnName != null and columnName != ''">column_name,</if>
|
| | |
| | | )
|
| | | </insert>
|
| | |
|
| | | <update id="updateGenTableColumn" parameterType="GenTableColumn">
|
| | | <update id="updateGenTableColumn" parameterType="com.ruoyi.project.tool.gen.domain.GenTableColumn"> |
| | | update gen_table_column
|
| | | <set>
|
| | | <if test="columnComment != null">column_comment = #{columnComment},</if>
|
ÎļþÃû´Ó src/main/resources/mybatis/tool/GenTableMapper.xml ÐÞ¸Ä |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableMapper">
|
| | |
|
| | | <resultMap type="GenTable" id="GenTableResult">
|
| | | <resultMap type="com.ruoyi.project.tool.gen.domain.GenTable" id="GenTableResult"> |
| | | <id property="tableId" column="table_id" />
|
| | | <result property="tableName" column="table_name" />
|
| | | <result property="tableComment" column="table_comment" />
|
| | |
| | | <collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap type="GenTableColumn" id="GenTableColumnResult">
|
| | | <resultMap type="com.ruoyi.project.tool.gen.domain.GenTableColumn" id="GenTableColumnResult"> |
| | | <id property="columnId" column="column_id" />
|
| | | <result property="tableId" column="table_id" />
|
| | | <result property="columnName" column="column_name" />
|
| | |
| | | select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
|
| | | </sql>
|
| | |
|
| | | <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
|
| | | <select id="selectGenTableList" parameterType="com.ruoyi.project.tool.gen.domain.GenTable" resultMap="GenTableResult"> |
| | | <include refid="selectGenTableVo"/>
|
| | | <where>
|
| | | <if test="tableName != null and tableName != ''">
|
| | |
| | | </where>
|
| | | </select>
|
| | |
|
| | | <select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
|
| | | <select id="selectDbTableList" parameterType="com.ruoyi.project.tool.gen.domain.GenTable" resultMap="GenTableResult"> |
| | | select table_name, table_comment, create_time, update_time from information_schema.tables
|
| | | where table_schema = (select database())
|
| | | AND table_name NOT LIKE 'qrtz\_%' AND table_name NOT LIKE 'gen\_%'
|
| | |
| | | order by c.sort
|
| | | </select>
|
| | |
|
| | | <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
| | | <insert id="insertGenTable" parameterType="com.ruoyi.project.tool.gen.domain.GenTable" useGeneratedKeys="true" keyProperty="tableId"> |
| | | insert into gen_table (
|
| | | <if test="tableName != null">table_name,</if>
|
| | | <if test="tableComment != null and tableComment != ''">table_comment,</if>
|
| | |
| | | ${sql}
|
| | | </update>
|
| | |
|
| | | <update id="updateGenTable" parameterType="GenTable">
|
| | | <update id="updateGenTable" parameterType="com.ruoyi.project.tool.gen.domain.GenTable"> |
| | | update gen_table
|
| | | <set>
|
| | | <if test="tableName != null">table_name = #{tableName},</if>
|