Ver código fonte

mysql转oracle数据库相关代码修改

wangggziwen 1 mês atrás
pai
commit
29c6a44d23
37 arquivos alterados com 635 adições e 443 exclusões
  1. 8 0
      pom.xml
  2. 6 0
      rc-admin/pom.xml
  3. 18 16
      rc-admin/src/main/java/com/ruoyi/web/controller/rc/TApproveDangerController.java
  4. 9 4
      rc-admin/src/main/resources/application-druid.yml
  5. 1 1
      rc-admin/src/main/resources/application.yml
  6. 38 9
      rc-buisness/src/main/resources/mapper/rc/TAuditMapper.xml
  7. 18 3
      rc-buisness/src/main/resources/mapper/rc/TChapterMapper.xml
  8. 13 3
      rc-buisness/src/main/resources/mapper/rc/TChapterTemplateMapper.xml
  9. 6 1
      rc-buisness/src/main/resources/mapper/rc/TCommonfileMapper.xml
  10. 5 0
      rc-buisness/src/main/resources/mapper/rc/TDeptInfoMapper.xml
  11. 6 1
      rc-buisness/src/main/resources/mapper/rc/TFileMapper.xml
  12. 5 0
      rc-buisness/src/main/resources/mapper/rc/TMeetingMapper.xml
  13. 6 1
      rc-buisness/src/main/resources/mapper/rc/TOpenItemMapper.xml
  14. 5 0
      rc-buisness/src/main/resources/mapper/rc/TProgressMapper.xml
  15. 5 0
      rc-buisness/src/main/resources/mapper/rc/TQuestionnaireMapper.xml
  16. 5 0
      rc-buisness/src/main/resources/mapper/rc/TQuestionnaireTemplateMapper.xml
  17. 22 0
      rc-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  18. 46 41
      rc-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
  19. 39 36
      rc-generator/src/main/resources/mapper/generator/GenTableMapper.xml
  20. 24 21
      rc-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
  21. 30 27
      rc-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
  22. 19 19
      rc-system/src/main/resources/mapper/system/SysConfigMapper.xml
  23. 32 29
      rc-system/src/main/resources/mapper/system/SysDeptMapper.xml
  24. 34 29
      rc-system/src/main/resources/mapper/system/SysDictDataMapper.xml
  25. 4 4
      rc-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
  26. 7 4
      rc-system/src/main/resources/mapper/system/SysLogininforMapper.xml
  27. 42 44
      rc-system/src/main/resources/mapper/system/SysMenuMapper.xml
  28. 24 19
      rc-system/src/main/resources/mapper/system/SysNoticeMapper.xml
  29. 44 6
      rc-system/src/main/resources/mapper/system/SysOperLogMapper.xml
  30. 25 22
      rc-system/src/main/resources/mapper/system/SysPostMapper.xml
  31. 33 30
      rc-system/src/main/resources/mapper/system/SysRoleMapper.xml
  32. 51 48
      rc-system/src/main/resources/mapper/system/SysUserMapper.xml
  33. 1 5
      ruoyi-ui/src/views/rc/audit/index.vue
  34. 1 5
      ruoyi-ui/src/views/rc/deptinfo/index.vue
  35. 1 5
      ruoyi-ui/src/views/rc/home-questionnaire/index.vue
  36. 1 5
      ruoyi-ui/src/views/rc/meeting/index.vue
  37. 1 5
      ruoyi-ui/src/views/rc/questionnaire/index.vue

+ 8 - 0
pom.xml

@@ -30,6 +30,7 @@
         <poi.version>4.1.2</poi.version>
         <velocity.version>2.3</velocity.version>
         <jwt.version>0.9.1</jwt.version>
+        <oracle.version>11.2.0.3</oracle.version>
     </properties>
 
     <!-- 依赖声明 -->
@@ -229,6 +230,13 @@
                 <artifactId>httpmime</artifactId>
                 <version>4.5.12</version>
             </dependency>
+
+            <!--oracle驱动-->
+            <dependency>
+                <groupId>com.oracle</groupId>
+                <artifactId>ojdbc6</artifactId>
+                <version>${oracle.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 6 - 0
rc-admin/pom.xml

@@ -37,6 +37,12 @@
             <version>1.6.2</version>
         </dependency>
 
+        <!--oracle驱动-->
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+        </dependency>
+
          <!-- Mysql驱动包 -->
         <dependency>
             <groupId>mysql</groupId>

+ 18 - 16
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TApproveDangerController.java

@@ -152,25 +152,27 @@ public class TApproveDangerController extends BaseController {
                 logger.info(task.getTenantId());
                 logger.info(task.getCategory());
                 logger.info(task.getFormKey());
-                logger.info("流程实例Name:" + pi.getProcessDefinitionName());
+//                logger.info("流程实例Name:" + pi.getProcessDefinitionName());
                 DevTask devTask = new DevTask();
                 devTask.setTaskId(task.getId());
                 devTask.setTaskName(task.getName());
                 devTask.setTaskCreateTime(task.getCreateTime());
                 devTask.setProcessId(task.getProcessInstanceId());
-                devTask.setProcessName(pi.getProcessDefinitionName());
-                devTask.setProcessCreateTime(pi.getStartTime());
-                devTask.setBusinessKey(pi.getBusinessKey());
-                devTask.setBusinessKey(pi.getBusinessKey());
-                if (pi.getProcessDefinitionName().equals("问卷审批流程")) {
-                    TProgress progress = tProgressService.selectTProgressById(Long.parseLong(pi.getBusinessKey()));
-                    devTask.setProgress(progress);
-                    devTask.setApNo(progress.getApNo());
-                } else if (pi.getProcessDefinitionName().equals("开项审批流程")) {
-                    TOpenItem openItem = tOpenItemService.selectTOpenItemById(Long.parseLong(pi.getBusinessKey()));
-                    devTask.setOpenItem(openItem);
-                    if (openItem != null) {
-                        devTask.setApNo(openItem.getApNo());
+                if (pi != null) {
+                    devTask.setProcessName(pi.getProcessDefinitionName());
+                    devTask.setProcessCreateTime(pi.getStartTime());
+                    devTask.setBusinessKey(pi.getBusinessKey());
+                    devTask.setBusinessKey(pi.getBusinessKey());
+                    if (pi.getProcessDefinitionName().equals("问卷审批流程")) {
+                        TProgress progress = tProgressService.selectTProgressById(Long.parseLong(pi.getBusinessKey()));
+                        devTask.setProgress(progress);
+                        devTask.setApNo(progress.getApNo());
+                    } else if (pi.getProcessDefinitionName().equals("开项审批流程")) {
+                        TOpenItem openItem = tOpenItemService.selectTOpenItemById(Long.parseLong(pi.getBusinessKey()));
+                        devTask.setOpenItem(openItem);
+                        if (openItem != null) {
+                            devTask.setApNo(openItem.getApNo());
+                        }
                     }
                 }
                 list.add(devTask);
@@ -205,12 +207,12 @@ public class TApproveDangerController extends BaseController {
                     continue;
                 }
                 DevProcess devProcess = new DevProcess();
-                if (pi.getProcessDefinitionName().equals("问卷审批流程")) {
+                if ("问卷审批流程".equals(pi.getProcessDefinitionName())) {
                     TProgress progress = tProgressService.selectTProgressById(Long.parseLong(pi.getBusinessKey()));
                     devProcess.setApNo(progress.getApNo());
                     devProcess.setProgress(progress);
                     devProcess.setApName(progress.getPersonInChargeName());
-                } else if (pi.getProcessDefinitionName().equals("开项审批流程")) {
+                } else if ("开项审批流程".equals(pi.getProcessDefinitionName())) {
                     TOpenItem openItem = tOpenItemService.selectTOpenItemById(Long.parseLong(pi.getBusinessKey()));
                     if (openItem != null) {
                         devProcess.setApNo(openItem.getApNo());

+ 9 - 4
rc-admin/src/main/resources/application-druid.yml

@@ -2,13 +2,18 @@
 spring:
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
+#        driverClassName: com.mysql.cj.jdbc.Driver
+        driverClassName: oracle.jdbc.OracleDriver
         druid:
             # 主库数据源
+#            master:
+#                url: jdbc:mysql://43.143.92.79:3306/rcaudit?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                username: root
+#                password: Ssy666666!
             master:
-                url: jdbc:mysql://43.143.92.79:3306/rcaudit?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: Ssy666666!
+                url: jdbc:oracle:thin:@47.114.101.16:1521/xe
+                username: rcaudit
+                password: ssy666666
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 1 - 1
rc-admin/src/main/resources/application.yml

@@ -122,7 +122,7 @@ mybatis:
 
 # PageHelper分页插件
 pagehelper:
-  helperDialect: mysql
+  helperDialect: oracle
   supportMethodsArguments: true
   params: count=countSql
 

+ 38 - 9
rc-buisness/src/main/resources/mapper/rc/TAuditMapper.xml

@@ -45,10 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectTAuditLatest" parameterType="TAudit" resultMap="TAuditResult">
-        <include refid="selectTAuditVo"/>
-        where dept_id like concat(concat('%', #{deptId}), '%')
-        order by d.audit_time desc, d.pre_audit_time desc
-        limit 1
+        select * from (
+            <include refid="selectTAuditVo"/>
+            where dept_id like concat(concat('%', #{deptId}), '%')
+            order by d.audit_time desc, d.pre_audit_time desc
+        ) where ROWNUM = 1
     </select>
     
     <select id="selectTAuditById" parameterType="Long" resultMap="TAuditResult">
@@ -57,8 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTAudit" parameterType="TAudit" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_audit.nextval as id from DUAL
+        </selectKey>
         insert into t_audit
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="year != null">year,</if>
             <if test="preAuditTime != null">pre_audit_time,</if>
             <if test="auditTime != null">audit_time,</if>
@@ -67,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="year != null">#{year},</if>
             <if test="preAuditTime != null">#{preAuditTime},</if>
             <if test="auditTime != null">#{auditTime},</if>
@@ -120,11 +126,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectHomeDataPie" parameterType="Long" resultType="Double">
-      select (
-        select count(*) from t_open_item o where o.questionnaire_id in (select id from t_questionnaire q where q.chapter_id in (select id from t_chapter ch where ch.audit_id = #{auditId})) and o.status = 4
-      ) / (
-        select count(*) from t_open_item o where o.questionnaire_id in (select id from t_questionnaire q where q.chapter_id in (select id from t_chapter ch where ch.audit_id = #{auditId}))
-      ) from dual
+        SELECT
+            NVL(
+                CASE
+                    WHEN total_count = 0 THEN NULL
+                    ELSE completed_count / total_count
+                END,
+                0
+            ) AS completion_ratio
+        FROM (
+            SELECT
+                (SELECT COUNT(*)
+                 FROM t_open_item o
+                 WHERE o.questionnaire_id IN (SELECT id
+                                              FROM t_questionnaire q
+                                              WHERE q.chapter_id IN (SELECT id
+                                                                     FROM t_chapter ch
+                                                                     WHERE ch.audit_id = #{auditId}))
+                   AND o.status = 4) AS completed_count,
+                (SELECT COUNT(*)
+                 FROM t_open_item o
+                 WHERE o.questionnaire_id IN (SELECT id
+                                              FROM t_questionnaire q
+                                              WHERE q.chapter_id IN (SELECT id
+                                                                     FROM t_chapter ch
+                                                                     WHERE ch.audit_id = #{auditId}))
+                ) AS total_count
+            FROM DUAL
+        ) subquery
     </select>
 
     <select id="selectLastAuditTimeList" resultMap="TAuditResult">

+ 18 - 3
rc-buisness/src/main/resources/mapper/rc/TChapterMapper.xml

@@ -13,7 +13,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTChapterVo">
-        select id, audit_id, code, name, dept_id, IF(INSTR(code, '.') > 0, SUBSTR(code, 1, INSTR(code, '.') - 1), code) as codeSubStr from t_chapter
+        SELECT
+               id,
+               audit_id,
+               code,
+               name,
+               dept_id,
+               CASE
+                 WHEN INSTR(code, '.') > 0 THEN SUBSTR(code, 1, INSTR(code, '.') - 1)
+                 ELSE code
+                   END AS codeSubStr
+        FROM t_chapter
     </sql>
 
     <select id="selectTChapterList" parameterType="TChapter" resultMap="TChapterResult">
@@ -21,10 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="auditId != null "> and audit_id = #{auditId}</if>
             <if test="code != null  and code != ''"> and code = #{code}</if>
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="name != null  and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
             <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
         </where>
-        order by (IF(INSTR(code, '.') > 0, SUBSTR(code, 1, INSTR(code, '.') - 1), code) + 0) asc, code asc
+        order by codeSubStr asc, code asc
     </select>
     
     <select id="selectTChapterById" parameterType="Long" resultMap="TChapterResult">
@@ -38,14 +48,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTChapter" parameterType="TChapter" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_chapter.nextval as id from DUAL
+        </selectKey>
         insert into t_chapter
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="auditId != null">audit_id,</if>
             <if test="code != null">code,</if>
             <if test="name != null">name,</if>
             <if test="deptId != null">dept_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="auditId != null">#{auditId},</if>
             <if test="code != null">#{code},</if>
             <if test="name != null">#{name},</if>

+ 13 - 3
rc-buisness/src/main/resources/mapper/rc/TChapterTemplateMapper.xml

@@ -12,7 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTChapterTemplateVo">
-        select ct.id, ct.code, ct.name, ct.dept_id, IF(INSTR(ct.code, '.') > 0, SUBSTR(ct.code, 1, INSTR(ct.code, '.') - 1), ct.code) as codeSubStr from t_chapter_template ct
+        select ct.id, ct.code, ct.name, ct.dept_id,
+        CASE
+                 WHEN INSTR(code, '.') > 0 THEN SUBSTR(code, 1, INSTR(code, '.') - 1)
+                 ELSE code
+                   END AS codeSubStr
+        from t_chapter_template ct
         left join sys_dept d on d.dept_id = ct.dept_id
     </sql>
 
@@ -20,11 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTChapterTemplateVo"/>
         <where>  
             <if test="code != null  and code != ''"> and ct.code = #{code}</if>
-            <if test="name != null  and name != ''"> and ct.name like concat('%', #{name}, '%')</if>
+            <if test="name != null  and name != ''"> and ct.name like concat(concat('%', #{name}), '%')</if>
             <if test="deptId != null  and deptId != ''"> and ct.dept_id = #{deptId}</if>
             ${params.dataScope}
         </where>
-        order by (IF(INSTR(ct.code, '.') > 0, SUBSTR(ct.code, 1, INSTR(ct.code, '.') - 1), ct.code) + 0) asc, ct.code asc
+        order by codeSubStr asc, ct.code asc
     </select>
 
     <select id="selectNameByCode" parameterType="String" resultType="String">
@@ -37,13 +42,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTChapterTemplate" parameterType="TChapterTemplate" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_chapter_template.nextval as id from DUAL
+        </selectKey>
         insert into t_chapter_template
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="code != null">code,</if>
             <if test="name != null">name,</if>
             <if test="deptId != null">dept_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="code != null">#{code},</if>
             <if test="name != null">#{name},</if>
             <if test="deptId != null">#{deptId},</if>

+ 6 - 1
rc-buisness/src/main/resources/mapper/rc/TCommonfileMapper.xml

@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTCommonfileVo"/>
         <where>  
             <if test="pId != null "> and p_id = #{pId}</if>
-            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat(concat('%', #{fileName}), '%')</if>
             <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
@@ -62,8 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTCommonfile" parameterType="TCommonfile" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_commonfile.nextval as id from DUAL
+        </selectKey>
         insert into t_commonfile
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="pId != null">p_id,</if>
             <if test="fileName != null">file_name,</if>
             <if test="fileUrl != null">file_url,</if>
@@ -79,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pDate != null">p_date,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="pId != null">#{pId},</if>
             <if test="fileName != null">#{fileName},</if>
             <if test="fileUrl != null">#{fileUrl},</if>

+ 5 - 0
rc-buisness/src/main/resources/mapper/rc/TDeptInfoMapper.xml

@@ -33,13 +33,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTDeptInfo" parameterType="TDeptInfo" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_dept_info.nextval as id from DUAL
+        </selectKey>
         insert into t_dept_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="deptInfo != null">dept_info,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="year != null">year,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="deptInfo != null">#{deptInfo},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="year != null">#{year},</if>

+ 6 - 1
rc-buisness/src/main/resources/mapper/rc/TFileMapper.xml

@@ -27,7 +27,7 @@
         <include refid="selectTFileVo"/>
         <where>
             <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
-            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat(concat('%', #{fileName}), '%')</if>
             <if test="fileSize != null  and fileSize != ''"> and file_size = #{fileSize}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="uploadDate != null "> and upload_date = #{uploadDate}</if>
@@ -45,8 +45,12 @@
     </select>
 
     <insert id="insertTFile" parameterType="TFile" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_file.nextval as id from DUAL
+        </selectKey>
         insert into t_file
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="fileUrl != null">file_url,</if>
             <if test="fileName != null">file_name,</if>
             <if test="fileSize != null">file_size,</if>
@@ -60,6 +64,7 @@
             <if test="pId != null">p_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="fileUrl != null">#{fileUrl},</if>
             <if test="fileName != null">#{fileName},</if>
             <if test="fileSize != null">#{fileSize},</if>

+ 5 - 0
rc-buisness/src/main/resources/mapper/rc/TMeetingMapper.xml

@@ -51,8 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTMeeting" parameterType="TMeeting" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_meeting.nextval as id from DUAL
+        </selectKey>
         insert into t_meeting
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="year != null">year,</if>
             <if test="questionnaireId != null">questionnaire_id,</if>
             <if test="personInCharge != null">person_in_charge,</if>
@@ -61,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditId != null">audit_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="year != null">#{year},</if>
             <if test="questionnaireId != null">#{questionnaireId},</if>
             <if test="personInCharge != null">#{personInCharge},</if>

+ 6 - 1
rc-buisness/src/main/resources/mapper/rc/TOpenItemMapper.xml

@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         q.directory, q.code, q.name,
         c.name as chap_name,
         a.audit_time
-        from t_open_item as o
+        from t_open_item o
         left join sys_user u1 on o.person_in_charge = u1.user_id
         left join sys_user u2 on o.reviewer = u2.user_id
         left join t_questionnaire q on q.id = o.questionnaire_id
@@ -77,8 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTOpenItem" parameterType="TOpenItem" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_open_item.nextval as id from DUAL
+        </selectKey>
         insert into t_open_item
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="type != null">type,</if>
             <if test="questionnaireId != null">questionnaire_id,</if>
             <if test="description != null">description,</if>
@@ -97,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditId != null">audit_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="type != null">#{type},</if>
             <if test="questionnaireId != null">#{questionnaireId},</if>
             <if test="description != null">#{description},</if>

+ 5 - 0
rc-buisness/src/main/resources/mapper/rc/TProgressMapper.xml

@@ -81,8 +81,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTProgress" parameterType="TProgress" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_progress.nextval as id from DUAL
+        </selectKey>
         insert into t_progress
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="questionnaireId != null">questionnaire_id,</if>
             <if test="chapName != null">chap_name,</if>
             <if test="subChapName != null">sub_chap_name,</if>
@@ -105,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="taskName != null">task_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="questionnaireId != null">#{questionnaireId},</if>
             <if test="chapName != null">#{chapName},</if>
             <if test="subChapName != null">#{subChapName},</if>

+ 5 - 0
rc-buisness/src/main/resources/mapper/rc/TQuestionnaireMapper.xml

@@ -91,8 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTQuestionnaire" parameterType="TQuestionnaire" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_questionnaire.nextval as id from DUAL
+        </selectKey>
         insert into t_questionnaire
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="auditId != null">audit_id,</if>
             <if test="chapterId != null">chapter_id,</if>
             <if test="year != null">year,</if>
@@ -111,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="auditId != null">#{auditId},</if>
             <if test="chapterId != null">#{chapterId},</if>
             <if test="year != null">#{year},</if>

+ 5 - 0
rc-buisness/src/main/resources/mapper/rc/TQuestionnaireTemplateMapper.xml

@@ -44,8 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <insert id="insertTQuestionnaireTemplate" parameterType="TQuestionnaireTemplate" useGeneratedKeys="true" keyProperty="id">
+        <selectKey keyProperty="id" order="BEFORE" resultType="Long">
+            select seq_t_questionnaire_template.nextval as id from DUAL
+        </selectKey>
         insert into t_questionnaire_template
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="chapterId != null">chapter_id,</if>
             <if test="chapterCode != null">chapter_id,</if>
             <if test="type != null">type,</if>
@@ -55,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="chapterId != null">#{chapterId},</if>
             <if test="chapterCode != null">
                 (select id from t_chapter_template ct where ct.code = #{chapterCode}),

+ 22 - 0
rc-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -70,6 +70,12 @@ public class SysUser extends BaseEntity
     @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
     private Date loginDate;
 
+    @Excel(dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
+    private Date beginTime;
+
+    @Excel(dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
+    private Date endTime;
+
     /** 部门对象 */
     @Excels({
         @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
@@ -94,6 +100,22 @@ public class SysUser extends BaseEntity
 
     }
 
+    public Date getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Date beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
     public SysUser(Long userId)
     {
         this.userId = userId;

+ 46 - 41
rc-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml

@@ -45,48 +45,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		order by ordinal_position
 	</select>
 
-    <insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
+    <insert id="insertGenTableColumn" parameterType="GenTableColumn">
+        <selectKey keyProperty="columnId" resultType="long" order="BEFORE">
+            SELECT seq_gen_table_column.NEXTVAL as columnId FROM DUAL
+        </selectKey>
         insert into gen_table_column (
-			<if test="tableId != null and tableId != ''">table_id,</if>
-			<if test="columnName != null and columnName != ''">column_name,</if>
-			<if test="columnComment != null and columnComment != ''">column_comment,</if>
-			<if test="columnType != null and columnType != ''">column_type,</if>
-			<if test="javaType != null and javaType != ''">java_type,</if>
-			<if test="javaField != null  and javaField != ''">java_field,</if>
-			<if test="isPk != null and isPk != ''">is_pk,</if>
-			<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
-			<if test="isRequired != null and isRequired != ''">is_required,</if>
-			<if test="isInsert != null and isInsert != ''">is_insert,</if>
-			<if test="isEdit != null and isEdit != ''">is_edit,</if>
-			<if test="isList != null and isList != ''">is_list,</if>
-			<if test="isQuery != null and isQuery != ''">is_query,</if>
-			<if test="queryType != null and queryType != ''">query_type,</if>
-			<if test="htmlType != null and htmlType != ''">html_type,</if>
-			<if test="dictType != null and dictType != ''">dict_type,</if>
-			<if test="sort != null">sort,</if>
-			<if test="createBy != null and createBy != ''">create_by,</if>
-			create_time
-         )values(
-			<if test="tableId != null and tableId != ''">#{tableId},</if>
-			<if test="columnName != null and columnName != ''">#{columnName},</if>
-			<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
-			<if test="columnType != null and columnType != ''">#{columnType},</if>
-			<if test="javaType != null and javaType != ''">#{javaType},</if>
-			<if test="javaField != null and javaField != ''">#{javaField},</if>
-			<if test="isPk != null and isPk != ''">#{isPk},</if>
-			<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
-			<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
-			<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
-			<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
-			<if test="isList != null and isList != ''">#{isList},</if>
-			<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
-			<if test="queryType != null and queryType != ''">#{queryType},</if>
-			<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
-			<if test="dictType != null and dictType != ''">#{dictType},</if>
-			<if test="sort != null">#{sort},</if>
-			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
-         )
+        <if test="columnId != null and columnId != ''">column_id,</if>
+        <if test="tableId != null and tableId != ''">table_id,</if>
+        <if test="columnName != null and columnName != ''">column_name,</if>
+        <if test="columnComment != null and columnComment != ''">column_comment,</if>
+        <if test="columnType != null and columnType != ''">column_type,</if>
+        <if test="javaType != null and javaType != ''">java_type,</if>
+        <if test="javaField != null  and javaField != ''">java_field,</if>
+        <if test="isPk != null and isPk != ''">is_pk,</if>
+        <if test="isIncrement != null and isIncrement != ''">is_increment,</if>
+        <if test="isRequired != null and isRequired != ''">is_required,</if>
+        <if test="isInsert != null and isInsert != ''">is_insert,</if>
+        <if test="isEdit != null and isEdit != ''">is_edit,</if>
+        <if test="isList != null and isList != ''">is_list,</if>
+        <if test="isQuery != null and isQuery != ''">is_query,</if>
+        <if test="queryType != null and queryType != ''">query_type,</if>
+        <if test="htmlType != null and htmlType != ''">html_type,</if>
+        <if test="dictType != null and dictType != ''">dict_type,</if>
+        <if test="sort != null">sort,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="columnId != null and columnId != ''">#{columnId},</if>
+        <if test="tableId != null and tableId != ''">#{tableId},</if>
+        <if test="columnName != null and columnName != ''">#{columnName},</if>
+        <if test="columnComment != null and columnComment != ''">#{columnComment},</if>
+        <if test="columnType != null and columnType != ''">#{columnType},</if>
+        <if test="javaType != null and javaType != ''">#{javaType},</if>
+        <if test="javaField != null and javaField != ''">#{javaField},</if>
+        <if test="isPk != null and isPk != ''">#{isPk},</if>
+        <if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
+        <if test="isRequired != null and isRequired != ''">#{isRequired},</if>
+        <if test="isInsert != null and isInsert != ''">#{isInsert},</if>
+        <if test="isEdit != null and isEdit != ''">#{isEdit},</if>
+        <if test="isList != null and isList != ''">#{isList},</if>
+        <if test="isQuery != null and isQuery != ''">#{isQuery},</if>
+        <if test="queryType != null and queryType != ''">#{queryType},</if>
+        <if test="htmlType != null and htmlType != ''">#{htmlType},</if>
+        <if test="dictType != null and dictType != ''">#{dictType},</if>
+        <if test="sort != null">#{sort},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate
+        )
     </insert>
 
     <update id="updateGenTableColumn" parameterType="GenTableColumn">

+ 39 - 36
rc-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -134,42 +134,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
 		order by c.sort
 	</select>
-	
-	<insert id="insertGenTable" parameterType="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>
-			<if test="className != null and className != ''">class_name,</if>
-			<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
-			<if test="tplWebType != null and tplWebType != ''">tpl_web_type,</if>
-			<if test="packageName != null and packageName != ''">package_name,</if>
-			<if test="moduleName != null and moduleName != ''">module_name,</if>
-			<if test="businessName != null and businessName != ''">business_name,</if>
-			<if test="functionName != null and functionName != ''">function_name,</if>
-			<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
-			<if test="genType != null and genType != ''">gen_type,</if>
-			<if test="genPath != null and genPath != ''">gen_path,</if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
-			create_time
-         )values(
-			<if test="tableName != null">#{tableName},</if>
-			<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
-			<if test="className != null and className != ''">#{className},</if>
-			<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
-			<if test="tplWebType != null and tplWebType != ''">#{tplWebType},</if>
-			<if test="packageName != null and packageName != ''">#{packageName},</if>
-			<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
-			<if test="businessName != null and businessName != ''">#{businessName},</if>
-			<if test="functionName != null and functionName != ''">#{functionName},</if>
-			<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
-			<if test="genType != null and genType != ''">#{genType},</if>
-			<if test="genPath != null and genPath != ''">#{genPath},</if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
-         )
-    </insert>
+
+	<insert id="insertGenTable" parameterType="GenTable">
+		<selectKey keyProperty="tableId" resultType="long" order="BEFORE">
+			SELECT seq_gen_table.NEXTVAL as tableId FROM DUAL
+		</selectKey>
+		insert into gen_table (
+		<if test="tableId != null">table_id,</if>
+		<if test="tableName != null">table_name,</if>
+		<if test="tableComment != null and tableComment != ''">table_comment,</if>
+		<if test="className != null and className != ''">class_name,</if>
+		<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
+		<if test="packageName != null and packageName != ''">package_name,</if>
+		<if test="moduleName != null and moduleName != ''">module_name,</if>
+		<if test="businessName != null and businessName != ''">business_name,</if>
+		<if test="functionName != null and functionName != ''">function_name,</if>
+		<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
+		<if test="genType != null and genType != ''">gen_type,</if>
+		<if test="genPath != null and genPath != ''">gen_path,</if>
+		<if test="remark != null and remark != ''">remark,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		create_time
+		)values(
+		<if test="tableId != null">#{tableId},</if>
+		<if test="tableName != null">#{tableName},</if>
+		<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
+		<if test="className != null and className != ''">#{className},</if>
+		<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
+		<if test="packageName != null and packageName != ''">#{packageName},</if>
+		<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
+		<if test="businessName != null and businessName != ''">#{businessName},</if>
+		<if test="functionName != null and functionName != ''">#{functionName},</if>
+		<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
+		<if test="genType != null and genType != ''">#{genType},</if>
+		<if test="genPath != null and genPath != ''">#{genPath},</if>
+		<if test="remark != null and remark != ''">#{remark},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		sysdate
+		)
+	</insert>
     
     <update id="createTable">
         ${sql}

+ 24 - 21
rc-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml

@@ -68,27 +68,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  	<update id="cleanJobLog">
         truncate table sys_job_log
     </update>
- 	
- 	<insert id="insertJobLog" parameterType="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>
- 			<if test="jobGroup != null and jobGroup != ''">job_group,</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
- 			<if test="jobMessage != null and jobMessage != ''">job_message,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
- 			create_time
- 		)values(
- 			<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
- 			<if test="jobName != null and jobName != ''">#{jobName},</if>
- 			<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
- 			<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
- 			sysdate()
- 		)
+
+	<insert id="insertJobLog" parameterType="SysJobLog">
+		<selectKey keyProperty="jobLogId" resultType="long" order="BEFORE">
+			SELECT seq_sys_job_log.NEXTVAL as jobLogId FROM DUAL
+		</selectKey>
+		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>
+		<if test="jobGroup != null and jobGroup != ''">job_group,</if>
+		<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
+		<if test="jobMessage != null and jobMessage != ''">job_message,</if>
+		<if test="status != null and status != ''">status,</if>
+		<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
+		create_time
+		)values(
+		<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
+		<if test="jobName != null and jobName != ''">#{jobName},</if>
+		<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
+		<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
+		<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
+		<if test="status != null and status != ''">#{status},</if>
+		<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
+		sysdate
+		)
 	</insert>
 
 </mapper> 

+ 30 - 27
rc-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml

@@ -79,33 +79,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		</set>
  		where job_id = #{jobId}
 	</update>
- 	
- 	<insert id="insertJob" parameterType="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>
- 			<if test="jobGroup != null and jobGroup != ''">job_group,</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
- 			<if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
- 			<if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy,</if>
- 			<if test="concurrent != null and concurrent != ''">concurrent,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="jobId != null and jobId != 0">#{jobId},</if>
- 			<if test="jobName != null and jobName != ''">#{jobName},</if>
- 			<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
- 			<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
- 			<if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
- 			<if test="misfirePolicy != null and misfirePolicy != ''">#{misfirePolicy},</if>
- 			<if test="concurrent != null and concurrent != ''">#{concurrent},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
+
+	<insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId">
+		<selectKey keyProperty="jobId" resultType="long" order="BEFORE">
+			SELECT seq_sys_job.NEXTVAL as jobId FROM DUAL
+		</selectKey>
+		insert into sys_job(
+		<if test="jobId != null and jobId != 0">job_id,</if>
+		<if test="jobName != null and jobName != ''">job_name,</if>
+		<if test="jobGroup != null and jobGroup != ''">job_group,</if>
+		<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
+		<if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
+		<if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy,</if>
+		<if test="concurrent != null and concurrent != ''">concurrent,</if>
+		<if test="status != null and status != ''">status,</if>
+		<if test="remark != null and remark != ''">remark,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		create_time
+		)values(
+		<if test="jobId != null and jobId != 0">#{jobId},</if>
+		<if test="jobName != null and jobName != ''">#{jobName},</if>
+		<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
+		<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
+		<if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
+		<if test="misfirePolicy != null and misfirePolicy != ''">#{misfirePolicy},</if>
+		<if test="concurrent != null and concurrent != ''">#{concurrent},</if>
+		<if test="status != null and status != ''">#{status},</if>
+		<if test="remark != null and remark != ''">#{remark},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		sysdate
+		)
 	</insert>
 
 </mapper> 

+ 19 - 19
rc-system/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -42,13 +42,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectConfigVo"/>
         <where>
 			<if test="configName != null and configName != ''">
-				AND config_name like concat('%', #{configName}, '%')
+				AND config_name like concat(concat('%',#{configName}),'%')
 			</if>
 			<if test="configType != null and configType != ''">
 				AND config_type = #{configType}
 			</if>
 			<if test="configKey != null and configKey != ''">
-				AND config_key like concat('%', #{configKey}, '%')
+				AND config_key like concat(concat('%',#{configKey}),'%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
@@ -68,25 +68,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectConfigVo"/>
         where config_key = #{configKey} limit 1
     </select>
-    
+
     <insert id="insertConfig" parameterType="SysConfig">
         insert into sys_config (
-			<if test="configName != null and configName != '' ">config_name,</if>
-			<if test="configKey != null and configKey != '' ">config_key,</if>
-			<if test="configValue != null and configValue != '' ">config_value,</if>
-			<if test="configType != null and configType != '' ">config_type,</if>
-			<if test="createBy != null and createBy != ''">create_by,</if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			create_time
+            <if test="configName != null and configName != '' ">config_name,</if>
+            <if test="configKey != null and configKey != '' ">config_key,</if>
+            <if test="configValue != null and configValue != '' ">config_value,</if>
+            <if test="configType != null and configType != '' ">config_type,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="remark != null and remark != ''">remark,</if>
+        create_time
         )values(
-			<if test="configName != null and configName != ''">#{configName},</if>
-			<if test="configKey != null and configKey != ''">#{configKey},</if>
-			<if test="configValue != null and configValue != ''">#{configValue},</if>
-			<if test="configType != null and configType != ''">#{configType},</if>
-			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
-		)
+            <if test="configName != null and configName != ''">#{configName},</if>
+            <if test="configKey != null and configKey != ''">#{configKey},</if>
+            <if test="configValue != null and configValue != ''">#{configValue},</if>
+            <if test="configType != null and configType != ''">#{configType},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="remark != null and remark != ''">#{remark},</if>
+            sysdate()
+        )
     </insert>
 	 
     <update id="updateConfig" parameterType="SysConfig">
@@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="configType != null and configType != ''">config_type = #{configType},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
         </set>
         where config_id = #{configId}
     </update>

+ 32 - 29
rc-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			AND parent_id = #{parentId}
 		</if>
 		<if test="deptName != null and deptName != ''">
-			AND dept_name like concat('%', #{deptName}, '%')
+			AND dept_name like concat(concat('%', #{deptName}), '%')
 		</if>
 		<if test="status != null and status != ''">
 			AND status = #{status}
@@ -86,33 +86,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	    <include refid="selectDeptVo"/>
 		where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
 	</select>
-    
-    <insert id="insertDept" parameterType="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>
- 			<if test="deptName != null and deptName != ''">dept_name,</if>
- 			<if test="ancestors != null and ancestors != ''">ancestors,</if>
- 			<if test="orderNum != null">order_num,</if>
- 			<if test="leader != null and leader != ''">leader,</if>
- 			<if test="phone != null and phone != ''">phone,</if>
- 			<if test="email != null and email != ''">email,</if>
- 			<if test="status != null">status,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="deptId != null and deptId != 0">#{deptId},</if>
- 			<if test="parentId != null and parentId != 0">#{parentId},</if>
- 			<if test="deptName != null and deptName != ''">#{deptName},</if>
- 			<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
- 			<if test="orderNum != null">#{orderNum},</if>
- 			<if test="leader != null and leader != ''">#{leader},</if>
- 			<if test="phone != null and phone != ''">#{phone},</if>
- 			<if test="email != null and email != ''">#{email},</if>
- 			<if test="status != null">#{status},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
+
+	<insert id="insertDept" parameterType="SysDept">
+	<selectKey keyProperty="deptId" resultType="long" order="BEFORE">
+		SELECT seq_sys_dept.NEXTVAL as deptId FROM DUAL
+	</selectKey>
+	insert into sys_dept(
+		<if test="deptId != null and deptId != 0">dept_id,</if>
+		<if test="parentId != null and parentId != 0">parent_id,</if>
+		<if test="deptName != null and deptName != ''">dept_name,</if>
+		<if test="ancestors != null and ancestors != ''">ancestors,</if>
+		<if test="orderNum != null">order_num,</if>
+		<if test="leader != null and leader != ''">leader,</if>
+		<if test="phone != null and phone != ''">phone,</if>
+		<if test="email != null and email != ''">email,</if>
+		<if test="status != null">status,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		create_time
+	)values(
+		<if test="deptId != null and deptId != 0">#{deptId},</if>
+		<if test="parentId != null and parentId != 0">#{parentId},</if>
+		<if test="deptName != null and deptName != ''">#{deptName},</if>
+		<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
+		<if test="orderNum != null">#{orderNum},</if>
+		<if test="leader != null and leader != ''">#{leader},</if>
+		<if test="phone != null and phone != ''">#{phone},</if>
+		<if test="email != null and email != ''">#{email},</if>
+		<if test="status != null">#{status},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		sysdate
+		)
 	</insert>
 	
 	<update id="updateDept" parameterType="SysDept">
@@ -127,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null">email = #{email},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where dept_id = #{deptId}
 	</update>

+ 34 - 29
rc-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND dict_type = #{dictType}
 			</if>
 			<if test="dictLabel != null and dictLabel != ''">
-				AND dict_label like concat('%', #{dictLabel}, '%')
+				AND dict_label like concat(concat('%', #{dictLabel}), '%')
 			</if>
 			<if test="status != null and status != ''">
 				AND status = #{status}
@@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where dict_code = #{dictCode}
 	</update>
@@ -92,33 +92,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<update id="updateDictDataType" parameterType="String">
  		update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
 	</update>
- 	
- 	<insert id="insertDictData" parameterType="SysDictData">
- 		insert into sys_dict_data(
- 			<if test="dictSort != null">dict_sort,</if>
- 			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
- 			<if test="dictValue != null and dictValue != ''">dict_value,</if>
- 			<if test="dictType != null and dictType != ''">dict_type,</if>
- 			<if test="cssClass != null and cssClass != ''">css_class,</if>
- 			<if test="listClass != null and listClass != ''">list_class,</if>
- 			<if test="isDefault != null and isDefault != ''">is_default,</if>
- 			<if test="status != null">status,</if>
- 			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 		    <if test="dictSort != null">#{dictSort},</if>
- 		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
- 			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
- 			<if test="dictType != null and dictType != ''">#{dictType},</if>
- 			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
- 			<if test="listClass != null and listClass != ''">#{listClass},</if>
- 			<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
- 			<if test="status != null">#{status},</if>
- 			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
+
+	<insert id="insertDictData" parameterType="SysDictData">
+		<selectKey keyProperty="dictCode" resultType="long" order="BEFORE">
+			SELECT SEQ_SYS_DICT_DATA.NEXTVAL as dictCode FROM DUAL
+		</selectKey>
+			insert into sys_dict_data(
+			<if test="dictCode != null">dict_code,</if>
+			<if test="dictSort != null">dict_sort,</if>
+			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
+			<if test="dictValue != null and dictValue != ''">dict_value,</if>
+			<if test="dictType != null and dictType != ''">dict_type,</if>
+			<if test="cssClass != null and cssClass != ''">css_class,</if>
+			<if test="listClass != null and listClass != ''">list_class,</if>
+			<if test="isDefault != null and isDefault != ''">is_default,</if>
+			<if test="status != null">status,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
+		)values(
+			<if test="dictCode != null">#{dictCode},</if>
+			<if test="dictSort != null">#{dictSort},</if>
+			<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
+			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
+			<if test="dictType != null and dictType != ''">#{dictType},</if>
+			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
+			<if test="listClass != null and listClass != ''">#{listClass},</if>
+			<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
+			<if test="status != null">#{status},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate
+		)
 	</insert>
 	
 </mapper> 

+ 4 - 4
rc-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -24,13 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	    <include refid="selectDictTypeVo"/>
 		<where>
 		    <if test="dictName != null and dictName != ''">
-				AND dict_name like concat('%', #{dictName}, '%')
+				AND dict_name like concat(concat('%', #{dictName}), '%')
 			</if>
 			<if test="status != null and status != ''">
 				AND status = #{status}
 			</if>
 			<if test="dictType != null and dictType != ''">
-				AND dict_type like concat('%', #{dictType}, '%')
+				AND dict_type like concat(concat('%', #{dictType}), '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
@@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where dict_id = #{dictId}
 	</update>
@@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			sysdate
  		)
 	</insert>
 	

+ 7 - 4
rc-system/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -17,21 +17,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 
 	<insert id="insertLogininfor" parameterType="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())
+		<selectKey keyProperty="infoId" resultType="long" order="BEFORE">
+			SELECT seq_sys_logininfor.NEXTVAL as infoId FROM DUAL
+		</selectKey>
+		insert into sys_logininfor (info_id, user_name, status, ipaddr, login_location, browser, os, msg, login_time)
+		values (#{infoId}, #{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate)
 	</insert>
 	
 	<select id="selectLogininforList" parameterType="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 != ''">
-				AND ipaddr like concat('%', #{ipaddr}, '%')
+				AND ipaddr like concat(concat('%', #{ipaddr}), '%')
 			</if>
 			<if test="status != null and status != ''">
 				AND status = #{status}
 			</if>
 			<if test="userName != null and userName != ''">
-				AND user_name like concat('%', #{userName}, '%')
+				AND user_name like concat(concat('%', #{userName}), '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 				AND login_time &gt;= #{params.beginTime}

+ 42 - 44
rc-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -29,7 +29,7 @@
 	</resultMap>
 
 	<sql id="selectMenuVo">
-        select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time 
+        select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, nvl(perms,'') as perms, icon, create_time
 		from sys_menu
     </sql>
     
@@ -37,7 +37,7 @@
 		<include refid="selectMenuVo"/>
 		<where>
 			<if test="menuName != null and menuName != ''">
-				AND menu_name like concat('%', #{menuName}, '%')
+				AND menu_name like concat(concat('%', #{menuName}), '%')
 			</if>
 			<if test="visible != null and visible != ''">
 				AND visible = #{visible}
@@ -50,20 +50,20 @@
 	</select>
 	
 	<select id="selectMenuTreeAll" 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
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, nvl(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 where m.menu_type in ('M', 'C') and m.status = 0
 		order by m.parent_id, m.order_num
 	</select>
 	
 	<select id="selectMenuListByUserId" parameterType="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
+		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
 		left join sys_user_role ur on rm.role_id = ur.role_id
 		left join sys_role ro on ur.role_id = ro.role_id
 		where ur.user_id = #{params.userId}
 		<if test="menuName != null and menuName != ''">
-            AND m.menu_name like concat('%', #{menuName}, '%')
+            AND m.menu_name like concat(concat('%', #{menuName}), '%')
 		</if>
 		<if test="visible != null and visible != ''">
             AND m.visible = #{visible}
@@ -75,7 +75,7 @@
 	</select>
     
     <select id="selectMenuTreeByUserId" parameterType="Long" 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
+		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
 			 left join sys_user_role ur on rm.role_id = ur.role_id
@@ -141,7 +141,7 @@
 			<if test="orderNum != null">order_num = #{orderNum},</if>
 			<if test="path != null and path != ''">path = #{path},</if>
 			<if test="component != null">component = #{component},</if>
-			<if test="query != null">`query` = #{query},</if>
+			<if test="query != null">query = #{query},</if>
 			<if test="routeName != null">route_name = #{routeName},</if>
 			<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
 			<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
@@ -152,50 +152,48 @@
 			<if test="icon !=null and icon != ''">icon = #{icon},</if>
 			<if test="remark != null and remark != ''">remark = #{remark},</if>
 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-			update_time = sysdate()
+			update_time = sysdate
 		</set>
 		where menu_id = #{menuId}
 	</update>
 
 	<insert id="insertMenu" parameterType="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>
-		<if test="menuName != null and menuName != ''">menu_name,</if>
-		<if test="orderNum != null">order_num,</if>
-		<if test="path != null and path != ''">path,</if>
-		<if test="component != null and component != ''">component,</if>
-		<if test="query != null and query != ''">`query`,</if>
-		<if test="routeName != null">route_name,</if>
-		<if test="isFrame != null and isFrame != ''">is_frame,</if>
-		<if test="isCache != null and isCache != ''">is_cache,</if>
-		<if test="menuType != null and menuType != ''">menu_type,</if>
-		<if test="visible != null">visible,</if>
-		<if test="status != null">status,</if>
-		<if test="perms !=null and perms != ''">perms,</if>
-		<if test="icon != null and icon != ''">icon,</if>
-		<if test="remark != null and remark != ''">remark,</if>
-		<if test="createBy != null and createBy != ''">create_by,</if>
-		create_time
+			<if test="menuId != null and menuId != 0">menu_id,</if>
+			<if test="parentId != null and parentId != 0">parent_id,</if>
+			<if test="menuName != null and menuName != ''">menu_name,</if>
+			<if test="orderNum != null">order_num,</if>
+			<if test="path != null and path != ''">path,</if>
+			<if test="component != null and component != ''">component,</if>
+			<if test="query != null and query != ''">query,</if>
+			<if test="isFrame != null and isFrame != ''">is_frame,</if>
+			<if test="isCache != null and isCache != ''">is_cache,</if>
+			<if test="menuType != null and menuType != ''">menu_type,</if>
+			<if test="visible != null">visible,</if>
+			<if test="status != null">status,</if>
+			<if test="perms !=null and perms != ''">perms,</if>
+			<if test="icon != null and icon != ''">icon,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
 		)values(
-		<if test="menuId != null and menuId != 0">#{menuId},</if>
-		<if test="parentId != null and parentId != 0">#{parentId},</if>
-		<if test="menuName != null and menuName != ''">#{menuName},</if>
-		<if test="orderNum != null">#{orderNum},</if>
-		<if test="path != null and path != ''">#{path},</if>
-		<if test="component != null and component != ''">#{component},</if>
-		<if test="query != null and query != ''">#{query},</if>
-		<if test="routeName != null">#{routeName},</if>
-		<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
-		<if test="isCache != null and isCache != ''">#{isCache},</if>
-		<if test="menuType != null and menuType != ''">#{menuType},</if>
-		<if test="visible != null">#{visible},</if>
-		<if test="status != null">#{status},</if>
-		<if test="perms !=null and perms != ''">#{perms},</if>
-		<if test="icon != null and icon != ''">#{icon},</if>
-		<if test="remark != null and remark != ''">#{remark},</if>
-		<if test="createBy != null and createBy != ''">#{createBy},</if>
-		sysdate()
+			<if test="menuId != null and menuId != 0">#{menuId},</if>
+			<if test="parentId != null and parentId != 0">#{parentId},</if>
+			<if test="menuName != null and menuName != ''">#{menuName},</if>
+			<if test="orderNum != null">#{orderNum},</if>
+			<if test="path != null and path != ''">#{path},</if>
+			<if test="component != null and component != ''">#{component},</if>
+			<if test="query != null and query != ''">#{query},</if>
+			<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
+			<if test="isCache != null and isCache != ''">#{isCache},</if>
+			<if test="menuType != null and menuType != ''">#{menuType},</if>
+			<if test="visible != null">#{visible},</if>
+			<if test="status != null">#{status},</if>
+			<if test="perms !=null and perms != ''">#{perms},</if>
+			<if test="icon != null and icon != ''">#{icon},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate
 		)
 	</insert>
 	

+ 24 - 19
rc-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -31,35 +31,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         <where>
 			<if test="noticeTitle != null and noticeTitle != ''">
-				AND notice_title like concat('%', #{noticeTitle}, '%')
+				AND notice_title like concat(concat('%', #{noticeTitle}), '%')
 			</if>
 			<if test="noticeType != null and noticeType != ''">
 				AND notice_type = #{noticeType}
 			</if>
 			<if test="createBy != null and createBy != ''">
-				AND create_by like concat('%', #{createBy}, '%')
+				AND create_by like concat(concat('%', #{createBy}), '%')
 			</if>
 		</where>
     </select>
     
     <insert id="insertNotice" parameterType="SysNotice">
+        <selectKey keyProperty="noticeId" order="BEFORE" resultType="long">
+            select seq_sys_notice.nextval as noticeId from DUAL
+        </selectKey>
         insert into sys_notice (
-			<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
-			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
-			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
-			<if test="status != null and status != '' ">status, </if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
-			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
-			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
-			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
-			<if test="status != null and status != ''">#{status}, </if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
-		)
+            <if test="noticeId != null and noticeId != '' ">notice_id, </if>
+            <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
+            <if test="noticeType != null and noticeType != '' ">notice_type, </if>
+            <if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
+            <if test="status != null and status != '' ">status, </if>
+            <if test="remark != null and remark != ''">remark,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            create_time
+        )values(
+            <if test="noticeId != null and noticeId != '' ">#{noticeId}, </if>
+            <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
+            <if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
+            <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
+            <if test="status != null and status != ''">#{status}, </if>
+            <if test="remark != null and remark != ''">#{remark},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            sysdate
+        )
     </insert>
 	 
     <update id="updateNotice" parameterType="SysNotice">
@@ -70,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
             <if test="status != null and status != ''">status = #{status}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
         </set>
         where notice_id = #{noticeId}
     </update>

+ 44 - 6
rc-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -28,20 +28,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select oper_id, 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, oper_time, cost_time
         from sys_oper_log
     </sql>
-    
+
 	<insert id="insertOperlog" parameterType="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())
+		<selectKey keyProperty="operId" resultType="long" order="BEFORE">
+			SELECT seq_sys_oper_log.NEXTVAL as operId FROM DUAL
+		</selectKey>
+		insert into sys_oper_log(
+			<if test="operId != null and operId != 0">oper_id,</if>
+			<if test="title != null and title != ''">title,</if>
+			<if test="businessType != null and businessType != ''">business_type,</if>
+			<if test="method != null and method != ''">method,</if>
+			<if test="requestMethod != null and requestMethod != ''">request_method,</if>
+			<if test="operatorType != null and operatorType != ''">operator_type,</if>
+			<if test="operName != null and operName != ''">oper_name,</if>
+			<if test="deptName != null and deptName != ''">dept_name,</if>
+			<if test="operUrl != null and operUrl != ''">oper_url,</if>
+			<if test="operIp != null and operIp != ''">oper_ip,</if>
+			<if test="operLocation != null and operLocation != ''">oper_location,</if>
+			<if test="operParam != null and operParam != ''">oper_param,</if>
+			<if test="jsonResult != null and jsonResult != ''">json_result,</if>
+			<if test="status != null and status != ''">status,</if>
+			<if test="errorMsg != null and errorMsg != ''">error_msg,</if>
+			<if test="costTime != null and costTime != ''">cost_time,</if>
+			oper_time
+		)values(
+			<if test="operId != null and operId != 0">#{operId},</if>
+			<if test="title != null and title != ''">#{title},</if>
+			<if test="businessType != null and businessType != ''">#{businessType},</if>
+			<if test="method != null and method != ''">#{method},</if>
+			<if test="requestMethod != null and requestMethod != ''">#{requestMethod},</if>
+			<if test="operatorType != null and operatorType != ''">#{operatorType},</if>
+			<if test="operName != null and operName != ''">#{operName},</if>
+			<if test="deptName != null and deptName != ''">#{deptName},</if>
+			<if test="operUrl != null and operUrl != ''">#{operUrl},</if>
+			<if test="operIp != null and operIp != ''">#{operIp},</if>
+			<if test="operLocation != null and operLocation != ''">#{operLocation},</if>
+			<if test="operParam != null and operParam != ''">#{operParam},</if>
+			<if test="jsonResult != null and jsonResult != ''">#{jsonResult},</if>
+			<if test="status != null and status != ''">#{status},</if>
+			<if test="errorMsg != null and errorMsg != ''">#{errorMsg},</if>
+			<if test="costTime != null and costTime != ''">#{costTime},</if>
+			sysdate
+		)
 	</insert>
 	
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
 		<include refid="selectOperLogVo"/>
 		<where>
 			<if test="operIp != null and operIp != ''">
-				AND oper_ip like concat('%', #{operIp}, '%')
+				AND oper_ip like concat(concat('%', #{operIp}), '%')
 			</if>
 			<if test="title != null and title != ''">
-				AND title like concat('%', #{title}, '%')
+				AND title like concat(concat('%', #{title}), '%')
 			</if>
 			<if test="businessType != null">
 				AND business_type = #{businessType}
@@ -56,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND status = #{status}
 			</if>
 			<if test="operName != null and operName != ''">
-				AND oper_name like concat('%', #{operName}, '%')
+				AND oper_name concat(like concat('%', #{operName}), '%')
 			</if>
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 				AND oper_time &gt;= #{params.beginTime}

+ 25 - 22
rc-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -26,13 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	    <include refid="selectPostVo"/>
 		<where>
 			<if test="postCode != null and postCode != ''">
-				AND post_code like concat('%', #{postCode}, '%')
+				AND post_code like concat(concat('%', #{postCode}), '%')
 			</if>
 			<if test="status != null and status != ''">
 				AND status = #{status}
 			</if>
 			<if test="postName != null and postName != ''">
-				AND post_name like concat('%', #{postName}, '%')
+				AND post_name like concat(concat('%', #{postName}), '%')
 			</if>
 		</where>
 	</select>
@@ -81,31 +81,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where post_id = #{postId}
 	</update>
  	
  	<insert id="insertPost" parameterType="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>
- 			<if test="postName != null and postName != ''">post_name,</if>
- 			<if test="postSort != null">post_sort,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="postId != null and postId != 0">#{postId},</if>
- 			<if test="postCode != null and postCode != ''">#{postCode},</if>
- 			<if test="postName != null and postName != ''">#{postName},</if>
- 			<if test="postSort != null">#{postSort},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
+		<selectKey keyProperty="postId" resultType="long" order="BEFORE">
+			SELECT seq_sys_post.NEXTVAL as postId FROM DUAL
+		</selectKey>
+		insert into sys_post(
+			<if test="postId != null and postId != 0">post_id,</if>
+			<if test="postCode != null and postCode != ''">post_code,</if>
+			<if test="postName != null and postName != ''">post_name,</if>
+			<if test="postSort != null">post_sort,</if>
+			<if test="status != null and status != ''">status,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
+		)values(
+			<if test="postId != null and postId != 0">#{postId},</if>
+			<if test="postCode != null and postCode != ''">#{postCode},</if>
+			<if test="postName != null and postName != ''">#{postName},</if>
+			<if test="postSort != null">#{postSort},</if>
+			<if test="status != null and status != ''">#{status},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate
+		)
 	</insert>
 	
 	<delete id="deletePostById" parameterType="Long">

+ 33 - 30
rc-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -37,13 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			AND r.role_id = #{roleId}
 		</if>
 		<if test="roleName != null and roleName != ''">
-			AND r.role_name like concat('%', #{roleName}, '%')
+			AND r.role_name like concat(concat('%', #{roleName}), '%')
 		</if>
 		<if test="status != null and status != ''">
 			AND r.status = #{status}
 		</if>
 		<if test="roleKey != null and roleKey != ''">
-			AND r.role_key like concat('%', #{roleKey}, '%')
+			AND r.role_key like concat(concat('%', #{roleKey}), '%')
 		</if>
 		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 			and date_format(r.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
@@ -92,33 +92,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<include refid="selectRoleVo"/>
 		 where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
 	</select>
-	
- 	<insert id="insertRole" parameterType="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>
- 			<if test="roleKey != null and roleKey != ''">role_key,</if>
- 			<if test="roleSort != null">role_sort,</if>
- 			<if test="dataScope != null and dataScope != ''">data_scope,</if>
- 			<if test="menuCheckStrictly != null">menu_check_strictly,</if>
- 			<if test="deptCheckStrictly != null">dept_check_strictly,</if>
- 			<if test="status != null and status != ''">status,</if>
- 			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="roleId != null and roleId != 0">#{roleId},</if>
- 			<if test="roleName != null and roleName != ''">#{roleName},</if>
- 			<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
- 			<if test="roleSort != null">#{roleSort},</if>
- 			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
- 			<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
- 			<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
- 			<if test="status != null and status != ''">#{status},</if>
- 			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
+
+	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
+		<selectKey keyProperty="roleId" resultType="long" order="BEFORE">
+			SELECT SEQ_SYS_ROLE.NEXTVAL as roleId FROM DUAL
+		</selectKey>
+		insert into sys_role(
+			<if test="roleId != null and roleId != 0">role_id,</if>
+			<if test="roleName != null and roleName != ''">role_name,</if>
+			<if test="roleKey != null and roleKey != ''">role_key,</if>
+			<if test="roleSort != null">role_sort,</if>
+			<if test="dataScope != null and dataScope != ''">data_scope,</if>
+			<if test="menuCheckStrictly != null">menu_check_strictly,</if>
+			<if test="deptCheckStrictly != null">dept_check_strictly,</if>
+			<if test="status != null and status != ''">status,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			create_time
+		)values(
+			<if test="roleId != null and roleId != 0">#{roleId},</if>
+			<if test="roleName != null and roleName != ''">#{roleName},</if>
+			<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
+			<if test="roleSort != null">#{roleSort},</if>
+			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
+			<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
+			<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
+			<if test="status != null and status != ''">#{status},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			sysdate
+		)
 	</insert>
 	
 	<update id="updateRole" parameterType="SysRole">
@@ -133,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where role_id = #{roleId}
 	</update>

+ 51 - 48
rc-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <association property="dept"    javaType="SysDept"         resultMap="deptResult" />
         <collection  property="roles"   javaType="java.util.List"  resultMap="RoleResult" />
     </resultMap>
-	
+
     <resultMap id="deptResult" type="SysDept">
         <id     property="deptId"    column="dept_id"     />
         <result property="parentId"  column="parent_id"   />
@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="leader"    column="leader"      />
         <result property="status"    column="dept_status" />
     </resultMap>
-	
+
     <resultMap id="RoleResult" type="SysRole">
         <id     property="roleId"       column="role_id"        />
         <result property="roleName"     column="role_name"      />
@@ -45,9 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dataScope"    column="data_scope"     />
         <result property="status"       column="role_status"    />
     </resultMap>
-	
+
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, 
+        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		    left join sys_user_role ur on u.user_id = ur.user_id
 		    left join sys_role r on r.role_id = ur.role_id
     </sql>
-    
+
     <select id="selectUserList" parameterType="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
@@ -64,22 +64,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			AND u.user_id = #{userId}
 		</if>
 		<if test="userName != null and userName != ''">
-			AND u.user_name like concat('%', #{userName}, '%')
+			AND u.user_name like concat(concat('%',#{userName}),'%')
 		</if>
 		<if test="status != null and status != ''">
 			AND u.status = #{status}
 		</if>
 		<if test="phonenumber != null and phonenumber != ''">
-			AND u.phonenumber like concat('%', #{phonenumber}, '%')
+			AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
 		</if>
-		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-			AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+		<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+			AND u.create_time &gt;= to_date(#{beginTime},'yyyy-MM-dd HH24:mi:ss')
 		</if>
-		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-			AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+		<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+			AND u.create_time &lt;= to_date(#{beginTime},'yyyy-MM-dd HH24:mi:ss')
 		</if>
 		<if test="deptId != null and deptId != 0">
-			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
+			and u.dept_id = #{deptId}
 		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
@@ -93,25 +93,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			AND u.user_id = #{userId}
 		</if>
 		<if test="userName != null and userName != ''">
-			AND u.user_name like concat('%', #{userName}, '%')
+			AND u.user_name like concat(concat('%',#{userName}),'%')
 		</if>
 		<if test="status != null and status != ''">
 			AND u.status = #{status}
 		</if>
 		<if test="phonenumber != null and phonenumber != ''">
-			AND u.phonenumber like concat('%', #{phonenumber}, '%')
+			AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
 		</if>
-		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-			AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+		<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+			AND u.create_time &gt;= to_date(#{beginTime},'yyyy-MM-dd HH24:mi:ss')
 		</if>
-		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-			AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+		<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+			AND u.create_time &lt;= to_date(#{endTime},'yyyy-MM-dd HH24:mi:ss')
 		</if>
 		<if test="deptId != null and deptId != 0">
-			AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
+			and u.dept_id = #{deptId}
 		</if>
 	</select>
-	
+
 	<select id="selectAllocatedList" parameterType="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
@@ -119,16 +119,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_role r on r.role_id = ur.role_id
 	    where u.del_flag = '0' and r.role_id = #{roleId}
-	    <if test="userName != null and userName != ''">
-			AND u.user_name like concat('%', #{userName}, '%')
+		<if test="userName != null and userName != ''">
+			AND u.user_name like concat(concat('%',#{userName}),'%')
 		</if>
 		<if test="phonenumber != null and phonenumber != ''">
-			AND u.phonenumber like concat('%', #{phonenumber}, '%')
+			AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
 		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 	</select>
-	
+
 	<select id="selectUnallocatedList" parameterType="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
@@ -137,39 +137,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			 left join sys_role r on r.role_id = ur.role_id
 	    where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
 	    and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
-	    <if test="userName != null and userName != ''">
-			AND u.user_name like concat('%', #{userName}, '%')
+		<if test="userName != null and userName != ''">
+			AND u.user_name like concat(concat('%',#{userName}),'%')
 		</if>
 		<if test="phonenumber != null and phonenumber != ''">
-			AND u.phonenumber like concat('%', #{phonenumber}, '%')
+			AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
 		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 	</select>
-	
+
 	<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
 	    <include refid="selectUserVo"/>
 		where u.user_name = #{userName} and u.del_flag = '0'
 	</select>
-	
+
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
 		where u.user_id = #{userId}
 	</select>
-	
-	<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
+
+	<select id="checkUserNameUnique" parameterType="String" resultType="int">
+		select count(1) from sys_user where user_name = #{userName} and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
+		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
-		select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
+		select user_id, email from sys_user where email = #{email} and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
+		<selectKey keyProperty="userId" order="BEFORE" resultType="Long">
+			select seq_sys_user.nextval as userId from DUAL
+		</selectKey>
  		insert into sys_user(
  			<if test="userId != null and userId != 0">user_id,</if>
  			<if test="deptId != null and deptId != 0">dept_id,</if>
@@ -197,10 +200,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
+ 			sysdate
  		)
 	</insert>
-	
+
 	<update id="updateUser" parameterType="SysUser">
  		update sys_user
  		<set>
@@ -217,32 +220,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where user_id = #{userId}
 	</update>
-	
+
 	<update id="updateUserStatus" parameterType="SysUser">
  		update sys_user set status = #{status} where user_id = #{userId}
 	</update>
-	
+
 	<update id="updateUserAvatar" parameterType="SysUser">
  		update sys_user set avatar = #{avatar} where user_name = #{userName}
 	</update>
-	
+
 	<update id="resetUserPwd" parameterType="SysUser">
  		update sys_user set password = #{password} where user_name = #{userName}
 	</update>
-	
+
 	<delete id="deleteUserById" parameterType="Long">
  		update sys_user set del_flag = '2' where user_id = #{userId}
  	</delete>
- 	
+
  	<delete id="deleteUserByIds" parameterType="Long">
  		update sys_user set del_flag = '2' where user_id in
  		<foreach collection="array" item="userId" open="(" separator="," close=")">
  			#{userId}
-        </foreach> 
+        </foreach>
  	</delete>
-	
-</mapper> 
+
+</mapper>

+ 1 - 5
ruoyi-ui/src/views/rc/audit/index.vue

@@ -90,11 +90,7 @@
     <el-table border v-loading="loading" :data="auditList" @selection-change="handleSelectionChange" ref='tableRef'>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="装置" align="center" prop="deptName" width="120"/>
-      <el-table-column label="年份" align="center" prop="year" width="120">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="年份" align="center" prop="year" width="120"/>
       <el-table-column label="预审时间" align="center" prop="preAuditTime" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.preAuditTime, '{y}-{m}-{d}') }}</span>

+ 1 - 5
ruoyi-ui/src/views/rc/deptinfo/index.vue

@@ -74,11 +74,7 @@
     <el-table border v-loading="loading" :data="deptinfoList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="装置" align="center" prop="deptName" width="120"/>
-      <el-table-column label="年份" align="center" prop="year" width="120">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="年份" align="center" prop="year" width="120"/>
       <el-table-column label="装置信息" align="center" prop="deptInfo" />
       <el-table-column label="装置平面图" align="center" width="120" fixed="right">
         <template slot-scope="scope">

+ 1 - 5
ruoyi-ui/src/views/rc/home-questionnaire/index.vue

@@ -2,11 +2,7 @@
   <div class="app-container" style="padding: 0px;">
     <el-table :height="clientHeight" border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange" style="font-size: 12px;">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="年份" align="center" prop="year">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="年份" align="center" prop="year"/>
       <el-table-column label="问卷类型" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.t_sec_sub_chap_type" :value="scope.row.type"/>

+ 1 - 5
ruoyi-ui/src/views/rc/meeting/index.vue

@@ -103,11 +103,7 @@
         </template>
       </el-table-column>
       <el-table-column label="装置" align="center" prop="deptName" width="120" />
-      <el-table-column label="年份" align="center" prop="year" width="120">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="年份" align="center" prop="year" width="120"/>
       <el-table-column label="章节" align="center" prop="chapName" width="250"/>
       <el-table-column label="目录" align="center" prop="directory" width="100" />
       <el-table-column label="涉及CODE" align="center" prop="code" width="100" />

+ 1 - 5
ruoyi-ui/src/views/rc/questionnaire/index.vue

@@ -102,11 +102,7 @@
 
     <el-table :height="clientHeight" border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange" style="font-size: 12px;">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="年份" align="center" prop="year">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="年份" align="center" prop="year"/>
       <el-table-column label="问卷类型" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.t_sec_sub_chap_type" :value="scope.row.type"/>