实现对角色的查询

master
GPU is all you need 4 years ago
parent 7cc61baa2d
commit de762e080c
  1. 4
      awardBE/src/main/java/edu/ncst/award/mapper/system/SysRoleMapper.java
  2. 19
      awardBE/src/main/resources/mapper/SysRoleMapper.xml

@ -1,8 +1,10 @@
package edu.ncst.award.mapper.system;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import edu.ncst.award.common.mapper.BaseMapperPlus;
import edu.ncst.award.model.system.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -21,6 +23,8 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, Role, Role>
* @return 角色数据集合信息
*/
List<Role> selectRoleList(Role role);
Page<Role> selectPageRoleList(@Param("page") Page<Role> page, @Param("role") Role role);
//
// /**
// * 根据用户ID查询角色

@ -44,4 +44,23 @@
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</select>
<select id="selectPageRoleList" parameterType="edu.ncst.award.model.system.Role" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where true
<if test="roleId != null and roleId != 0">
AND r.role_id = #{roleId}
</if>
<if test="name != null and name != ''">
AND r.name like concat('%', #{name}, '%')
</if>
<if test="enable != null and enable != ''">
AND r.enable = #{enable}
</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')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</select>
</mapper>

Loading…
Cancel
Save