10 小时以前 3d556b8defe1ff5b9aeb481bd1d0a67b2ded0192
Merge remote-tracking branch 'origin/dev_New_pro' into dev_New_pro
已修改23个文件
226 ■■■■■ 文件已修改
src/main/java/com/ruoyi/device/service/impl/MaintenanceTaskServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/aftersalesservice/AfterSalesNearExpiryMapper.xml 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/aftersalesservice/AfterSalesServiceMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/approve/ApprovalInstanceMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/approve/FinReimbursementMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/EnterpriseNewsMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceRepairMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/measuringinstrumentledger/SparePartsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/measuringinstrumentledger/SparePartsRequisitionRecordMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/StaffLeaveMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/StaffOnJobMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysDeptMapper.xml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysDictTypeMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysPostMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysRoleMapper.xml 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/system/SysUserMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/impl/MaintenanceTaskServiceImpl.java
@@ -1,5 +1,6 @@
package com.ruoyi.device.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.bean.BeanUtils;
@@ -34,7 +35,7 @@
    @Override
    public AjaxResult listPage(Page page, MaintenanceTask maintenanceTask) {
        Page<MaintenanceTask> taskPage = maintenanceTaskMapper.selectPage(page, null);
        Page<MaintenanceTask> taskPage = maintenanceTaskMapper.selectPage(page, new QueryWrapper<MaintenanceTask>().orderByDesc("create_time"));
        // 2. 如果没有数据,直接返回空分页
        if (taskPage.getRecords().isEmpty()) {
            return AjaxResult.success(taskPage);
src/main/java/com/ruoyi/inspectiontask/service/impl/InspectionTaskServiceImpl.java
@@ -67,6 +67,7 @@
        if (StringUtils.isNotBlank(inspectionTaskDto.getInspectionProject())) {
            queryWrapper.like(InspectionTask::getInspectionProject, inspectionTaskDto.getInspectionProject());
        }
        queryWrapper.orderByDesc(InspectionTask::getCreateTime);
        IPage<InspectionTask> entityPage = inspectionTaskMapper.selectPage(page, queryWrapper);
        //  无数据提前返回
src/main/java/com/ruoyi/inspectiontask/service/impl/TimingTaskServiceImpl.java
@@ -53,6 +53,7 @@
        if (timingTask.getIsEnabled() != null) {
            queryWrapper.eq(TimingTask::getIsEnabled, timingTask.getIsEnabled());
        }
        queryWrapper.orderByDesc(TimingTask::getCreateTime);
        IPage<TimingTask> taskPage = timingTaskMapper.selectPage(page, queryWrapper);
        // 2. 如果没有数据,直接返回空分页
src/main/resources/mapper/aftersalesservice/AfterSalesNearExpiryMapper.xml
@@ -25,17 +25,18 @@
    <select id="listPage" resultType="com.ruoyi.aftersalesservice.pojo.AfterSalesNearExpiry">
        select * from after_sales_near_expiry
        where 1 = 1
        <if test="req.expireDate != null">
            AND expire_date = #{req.expireDate}
        </if>
        <if test="req.disDate != null">
            AND dis_date = #{req.disDate}
        </if>
        <if test="req.status != null">
            AND status = #{req.status}
        </if>
        <where>
            <if test="req.expireDate != null">
                AND expire_date = #{req.expireDate}
            </if>
            <if test="req.disDate != null">
                AND dis_date = #{req.disDate}
            </if>
            <if test="req.status != null">
                AND status = #{req.status}
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
</mapper>
src/main/resources/mapper/aftersalesservice/AfterSalesServiceMapper.xml
@@ -32,7 +32,7 @@
        <if test="req.serviceType != null">
            and service_type = #{req.serviceType}
        </if>
        order by update_time desc
        order by create_time desc
    </select>
    <select id="countAfterSalesService" resultType="com.ruoyi.aftersalesservice.dto.CountDto">
        select
@@ -42,4 +42,4 @@
        group by status
    </select>
</mapper>
</mapper>
src/main/resources/mapper/approve/ApprovalInstanceMapper.xml
@@ -52,7 +52,7 @@
                and ai.applicant_name = #{ew.applicantName}
            </if>
        </where>
        order by ai.id desc
        order by ai.create_time desc
    </select>
</mapper>
src/main/resources/mapper/approve/FinReimbursementMapper.xml
@@ -56,6 +56,7 @@
                and create_time &lt;= #{ew.createTimeEnd}
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
src/main/resources/mapper/collaborativeApproval/EnterpriseNewsMapper.xml
@@ -41,6 +41,7 @@
                and en.create_time between #{enterpriseNewsDto.createTimeStart} and #{enterpriseNewsDto.createTimeEnd}
            </if>
        </where>
        order by en.create_time desc
    </select>
</mapper>
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml
@@ -17,6 +17,6 @@
                and n.status = #{ew.status}
            </if>
        </where>
        order by n.id desc
        order by n.create_time desc
    </select>
</mapper>
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -26,7 +26,6 @@
        left join device_ledger dl on dm.device_ledger_id = dl.id
        left join sys_user su on dm.create_user = su.user_id
        <where>
            1 = 1
            <if test="deviceMaintenanceDto.deviceName != null">
                and dl.device_name like concat('%',#{deviceMaintenanceDto.deviceName},'%')
            </if>
@@ -50,6 +49,7 @@
                and dm.maintenance_actually_time &lt; date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day)
            </if>
        </where>
        order by dm.create_time desc
    </select>
    <select id="detailById" resultType="com.ruoyi.device.vo.DeviceMaintenanceVo">
        select dm.id,
src/main/resources/mapper/device/DeviceRepairMapper.xml
@@ -29,7 +29,6 @@
        from device_repair dr
        left join device_ledger dl on dr.device_ledger_id = dl.id
        <where>
            1 = 1
            <if test="deviceRepairDto.deviceName != null">
                and dl.device_name like concat('%',#{deviceRepairDto.deviceName},'%')
            </if>
@@ -53,6 +52,7 @@
                and dr.maintenance_time like concat('%',#{deviceRepairDto.maintenanceTimeStr},'%')
            </if>
        </where>
        order by dr.create_time desc
    </select>
    <select id="detailById" resultType="com.ruoyi.device.vo.DeviceRepairVo">
        select dr.id,
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -62,6 +62,6 @@
                AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY update_time DESC
        ORDER BY create_time DESC
    </select>
</mapper>
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml
@@ -32,7 +32,7 @@
                AND t1.record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY t1.update_time DESC
        ORDER BY t1.create_time DESC
    </select>
    <select id="list" resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord">
        SELECT
@@ -65,4 +65,4 @@
        </where>
        ORDER BY t1.update_time DESC
    </select>
</mapper>
</mapper>
src/main/resources/mapper/measuringinstrumentledger/SparePartsMapper.xml
@@ -10,5 +10,6 @@
                and sp.name like concat('%',#{spareParts.name},'%')
            </if>
        </where>
        order by sp.create_time desc
    </select>
</mapper>
</mapper>
src/main/resources/mapper/measuringinstrumentledger/SparePartsRequisitionRecordMapper.xml
@@ -32,5 +32,6 @@
                and sprr.source_type = #{params.sourceType}
            </if>
        </where>
        order by sprr.create_time desc
    </select>
</mapper>
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -132,10 +132,12 @@
        from sales_ledger sl
        left join purchase_ledger pl on sl.id = pl.sales_ledger_id
        left join customer c on sl.customer_id = c.id
        where 1=1
        <if test="customerName != null and customerName != '' ">
            and c.customer_name like concat('%',#{customerName},'%')
        </if>
        <where>
            <if test="customerName != null and customerName != '' ">
                and c.customer_name like concat('%',#{customerName},'%')
            </if>
        </where>
        order by sl.create_time desc
    </select>
</mapper>
src/main/resources/mapper/staff/StaffLeaveMapper.xml
@@ -35,7 +35,7 @@
        <if test="c.staffName != null and c.staffName != '' ">
            AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%')
        </if>
        order by staff_leave.id desc
        order by staff_leave.create_time desc
    </select>
    <select id="staffLeaveList" resultType="com.ruoyi.staff.dto.StaffLeaveDto">
        SELECT
@@ -62,10 +62,12 @@
        sys_post sp ON sp.post_id = soj.sys_post_id
        LEFT JOIN
        sys_dept sd ON sd.dept_id = soj.sys_dept_id
        where 1=1
        <if test="c.staffName != null and c.staffName != '' ">
            AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%')
        </if>
        <where>
            <if test="c.staffName != null and c.staffName != '' ">
                AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%')
            </if>
        </where>
        order by staff_leave.create_time desc
    </select>
    <select id="staffLeaveReasonAnalytics" resultType="com.ruoyi.staff.dto.StaffLeaveDto">
src/main/resources/mapper/staff/StaffOnJobMapper.xml
@@ -79,7 +79,7 @@
        <if test="staffOnJob.contractStartTime != null">
            HAVING MIN(t1.contract_start_time) = #{staffOnJob.contractStartTime}
        </if>
        order by staff_on_job.id desc
        order by staff_on_job.create_time desc
    </select>
    <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto">
        SELECT
@@ -91,13 +91,15 @@
        sys_post sp ON sp.post_id = staff_on_job.sys_post_id
        LEFT JOIN
        sys_dept sd ON sd.dept_id = staff_on_job.sys_dept_id
        where 1=1
        <if test="staffOnJob.staffState != null">
            AND staff_state = #{staffOnJob.staffState}
        </if>
        <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' ">
            AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%')
        </if>
        <where>
            <if test="staffOnJob.staffState != null">
                AND staff_state = #{staffOnJob.staffState}
            </if>
            <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' ">
                AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%')
            </if>
        </where>
        order by staff_on_job.create_time desc
    </select>
    <!-- 统计指定日期的在职员工数 -->
    <select id="countOnJobStaffByDate" resultType="java.lang.Integer">
src/main/resources/mapper/system/SysDeptMapper.xml
@@ -22,10 +22,11 @@
        <result property="updateTime" column="update_time" />
        <result property="staffCount" column="staff_count" />
    </resultMap>
    <sql id="selectDeptVo">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
        from sys_dept d
        order by d.create_time desc
    </sql>
    <select id="selectDeptList" parameterType="com.ruoyi.project.system.domain.SysDept" resultMap="SysDeptResult">
@@ -49,9 +50,9 @@
        <!-- 数据范围过滤 -->
        ${params.dataScope}
        group by d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
        order by d.parent_id, d.order_num
        order by d.parent_id asc, d.order_num asc, d.create_time desc
    </select>
    <select id="selectDeptListByRoleId" resultType="java.lang.Long">
        select d.dept_id
        from sys_dept d
@@ -60,39 +61,40 @@
            <if test="deptCheckStrictly">
              and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
            </if>
        order by d.parent_id, d.order_num
        order by d.parent_id asc, d.order_num asc, d.create_time desc
    </select>
    <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
            (select dept_name from sys_dept where dept_id = d.parent_id) parent_name,
            d.dept_nick
        from sys_dept d
        where d.dept_id = #{deptId}
        order by d.create_time desc
    </select>
    <select id="checkDeptExistUser" parameterType="Long" resultType="int">
        select count(1) from sys_user_dept where dept_id = #{deptId}
    </select>
    <select id="hasChildByDeptId" parameterType="Long" resultType="int">
        select count(1) from sys_dept
        where del_flag = '0' and parent_id = #{deptId} limit 1
    </select>
    <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
        select * from sys_dept where find_in_set(#{deptId}, ancestors)
    </select>
    <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
        select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
    </select>
    <select id="checkDeptNameUnique" resultMap="SysDeptResult">
        <include refid="selectDeptVo"/>
        where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
    </select>
    <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept">
         insert into sys_dept(
             <if test="deptId != null and deptId != 0">dept_id,</if>
@@ -122,7 +124,7 @@
             sysdate()
         )
    </insert>
    <update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept">
         update sys_dept
         <set>
@@ -140,7 +142,7 @@
         </set>
         where dept_id = #{deptId}
    </update>
    <update id="updateDeptChildren" parameterType="java.util.List">
        update sys_dept set ancestors =
        <foreach collection="depts" item="item" index="index"
@@ -153,14 +155,14 @@
            #{item.deptId}
        </foreach>
    </update>
    <update id="updateDeptStatusNormal" parameterType="Long">
         update sys_dept set status = '0' where dept_id in
         update sys_dept set status = '0' where dept_id in
         <foreach collection="array" item="deptId" open="(" separator="," close=")">
            #{deptId}
        </foreach>
    </update>
    <delete id="deleteDeptById" parameterType="Long">
        update sys_dept set del_flag = '2' where dept_id = #{deptId}
    </delete>
@@ -184,4 +186,4 @@
        WHERE parent_id = 100;
    </select>
</mapper>
</mapper>
src/main/resources/mapper/system/SysDictTypeMapper.xml
@@ -14,9 +14,9 @@
        <result property="updateBy"   column="update_by"   />
        <result property="updateTime" column="update_time" />
    </resultMap>
    <sql id="selectDictTypeVo">
        select dict_id, dict_name, dict_type, status, create_by, create_time, remark
        select dict_id, dict_name, dict_type, status, create_by, create_time, remark
        from sys_dict_type
    </sql>
@@ -39,36 +39,37 @@
                and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
            </if>
        </where>
        order by create_time desc
    </select>
    <select id="selectDictTypeAll" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
    </select>
    <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        where dict_id = #{dictId}
    </select>
    <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        where dict_type = #{dictType}
    </select>
    <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
        <include refid="selectDictTypeVo"/>
        where dict_type = #{dictType} limit 1
    </select>
    <delete id="deleteDictTypeById" parameterType="Long">
         delete from sys_dict_type where dict_id = #{dictId}
     </delete>
     <delete id="deleteDictTypeByIds" parameterType="Long">
         delete from sys_dict_type where dict_id in
         <foreach collection="array" item="dictId" open="(" separator="," close=")">
             #{dictId}
        </foreach>
        </foreach>
     </delete>
     <update id="updateDictType" parameterType="com.ruoyi.project.system.domain.SysDictType">
@@ -83,7 +84,7 @@
         </set>
         where dict_id = #{dictId}
    </update>
     <insert id="insertDictType" parameterType="com.ruoyi.project.system.domain.SysDictType">
         insert into sys_dict_type(
             <if test="dictName != null and dictName != ''">dict_name,</if>
@@ -101,5 +102,5 @@
             sysdate()
         )
    </insert>
</mapper>
</mapper>
src/main/resources/mapper/system/SysPostMapper.xml
@@ -16,12 +16,12 @@
        <result property="updateTime"    column="update_time"   />
        <result property="remark"        column="remark"        />
    </resultMap>
    <sql id="selectPostVo">
        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
        from sys_post
    </sql>
    <select id="selectPostList" parameterType="com.ruoyi.project.system.domain.SysPost" resultMap="SysPostResult">
        <include refid="selectPostVo"/>
        <where>
@@ -35,17 +35,18 @@
                AND post_name like concat('%', #{postName}, '%')
            </if>
        </where>
        order by create_time desc
    </select>
    <select id="selectPostAll" resultMap="SysPostResult">
        <include refid="selectPostVo"/>
    </select>
    <select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
        <include refid="selectPostVo"/>
        where post_id = #{postId}
    </select>
    <select id="selectPostListByUserId" parameterType="Long" resultType="Long">
        select p.post_id
        from sys_post p
@@ -53,7 +54,7 @@
            left join sys_user u on u.user_id = up.user_id
        where u.user_id = #{userId}
    </select>
    <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
        select p.post_id, p.post_name, p.post_code
        from sys_post p
@@ -61,17 +62,17 @@
             left join sys_user u on u.user_id = up.user_id
        where u.user_name = #{userName}
    </select>
    <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
        <include refid="selectPostVo"/>
         where post_name=#{postName} limit 1
    </select>
    <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
        <include refid="selectPostVo"/>
         where post_code=#{postCode} limit 1
    </select>
    <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost">
         update sys_post
         <set>
@@ -85,7 +86,7 @@
         </set>
         where post_id = #{postId}
    </update>
     <insert id="insertPost" parameterType="com.ruoyi.project.system.domain.SysPost" useGeneratedKeys="true" keyProperty="postId">
         insert into sys_post(
             <if test="postId != null and postId != 0">post_id,</if>
@@ -107,16 +108,16 @@
             sysdate()
         )
    </insert>
    <delete id="deletePostById" parameterType="Long">
        delete from sys_post where post_id = #{postId}
    </delete>
    <delete id="deletePostByIds" parameterType="Long">
         delete from sys_post where post_id in
         <foreach collection="array" item="postId" open="(" separator="," close=")">
             #{postId}
        </foreach>
        </foreach>
     </delete>
</mapper>
</mapper>
src/main/resources/mapper/system/SysRoleMapper.xml
@@ -20,10 +20,10 @@
        <result property="updateTime"         column="update_time"           />
        <result property="remark"             column="remark"                />
    </resultMap>
    <sql id="selectRoleVo">
        select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
            r.status, r.del_flag, r.create_time, r.remark
            r.status, r.del_flag, r.create_time, r.remark
        from sys_role r
            left join sys_user_role ur on ur.role_id = r.role_id
            left join sys_user u on u.user_id = ur.user_id
@@ -54,17 +54,17 @@
        ${params.dataScope}
        order by r.role_sort
    </select>
    <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
        WHERE r.del_flag = '0' and ur.user_id = #{userId}
    </select>
    <select id="selectRoleAll" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
        WHERE r.del_flag = '0'
    </select>
    <select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
        select r.role_id
        from sys_role r
@@ -72,27 +72,27 @@
            left join sys_user u on u.user_id = ur.user_id
        where u.user_id = #{userId}
    </select>
    <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
        where r.role_id = #{roleId}
    </select>
    <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
        WHERE r.del_flag = '0' and u.user_name = #{userName}
    </select>
    <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
         where r.role_name=#{roleName} and r.del_flag = '0' limit 1
    </select>
    <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
        <include refid="selectRoleVo"/>
         where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
    </select>
     <insert id="insertRole" parameterType="com.ruoyi.project.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
         insert into sys_role(
             <if test="roleId != null and roleId != 0">role_id,</if>
@@ -120,7 +120,7 @@
             sysdate()
         )
    </insert>
    <update id="updateRole" parameterType="com.ruoyi.project.system.domain.SysRole">
         update sys_role
         <set>
@@ -137,16 +137,16 @@
         </set>
         where role_id = #{roleId}
    </update>
    <delete id="deleteRoleById" parameterType="Long">
         update sys_role set del_flag = '2' where role_id = #{roleId}
     </delete>
     <delete id="deleteRoleByIds" parameterType="Long">
         update sys_role set del_flag = '2' where role_id in
         <foreach collection="array" item="roleId" open="(" separator="," close=")">
             #{roleId}
        </foreach>
        </foreach>
     </delete>
</mapper>
</mapper>
src/main/resources/mapper/system/SysUserMapper.xml
@@ -97,6 +97,7 @@
        </if>
        <!-- 数据范围过滤 -->
        ${params.dataScope}
        ORDER BY u.create_time DESC
    </select>
    <select id="selectAllocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult">
@@ -130,17 +131,20 @@
        </if>
        <!-- 数据范围过滤 -->
        ${params.dataScope}
        ORDER BY u.create_time DESC
    </select>
    <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
        where u.user_name = #{userName} and u.del_flag = '0'
        ORDER BY u.create_time DESC
    </select>
    <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
        where u.user_id = #{userId}
        and u.del_flag = '0'
        ORDER BY u.create_time DESC
    </select>
    <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
@@ -165,6 +169,7 @@
            </if>
            and u.del_flag = '0'
        </where>
        ORDER BY u.create_time DESC
    </select>
    <select id="selectRegistrantIds" resultType="com.ruoyi.project.system.domain.SysUser">
        SELECT user_id, nick_name FROM sys_user
@@ -179,6 +184,7 @@
                1=0  <!-- 空列表时返回空结果 -->
            </if>
        </where>
        ORDER BY sys_user.create_time DESC
    </select>
    <select id="selectUsersByIds" resultType="com.ruoyi.project.system.domain.SysUser">
        SELECT user_id, nick_name
@@ -188,6 +194,7 @@
            #{id}
        </foreach>
        and del_flag = '0'
        ORDER BY sys_user.create_time DESC
    </select>
    <select id="selectUserByNickName" resultType="com.ruoyi.project.system.domain.SysUser"
            parameterType="java.lang.String">
@@ -281,6 +288,7 @@
          and sr.status = '0'
          and su.status = '0'
          and su.del_flag = '0'
        ORDER BY su.create_time DESC
    </select>
    <select id="getUserByPerms" resultType="java.lang.Long">
        select distinct t5.user_id