岗位配置模糊查询分页
This commit is contained in:
@@ -57,6 +57,14 @@ public interface TsPositionDao extends BaseMapper<TsPosition> {
|
|||||||
*/
|
*/
|
||||||
List<TsPosition> selectPositionAndRole(TsPosition tsPosition);
|
List<TsPosition> selectPositionAndRole(TsPosition tsPosition);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
* @param tsPosition
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer countPositionAndRole(TsPosition tsPosition);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位列表查询绑定的角色列表
|
* 通过岗位列表查询绑定的角色列表
|
||||||
* @param positionIds:岗位列表
|
* @param positionIds:岗位列表
|
||||||
|
|||||||
+3
-2
@@ -44,9 +44,10 @@ public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition
|
|||||||
@Override
|
@Override
|
||||||
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
||||||
IPage page=new Page();
|
IPage page=new Page();
|
||||||
|
// page.setTotal(tsPositionDao.pageTotal());
|
||||||
page.setTotal(tsPositionDao.pageTotal());
|
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
||||||
page.setRecords(tsPositionDao.selectPositionAndRole(tsPosition));
|
page.setRecords(tsPositionDao.selectPositionAndRole(tsPosition));
|
||||||
|
page.setTotal(page.getTotal());
|
||||||
page.setCurrent(tsPosition.getCurrent());
|
page.setCurrent(tsPosition.getCurrent());
|
||||||
page.setSize(tsPosition.getPageSize());
|
page.setSize(tsPosition.getPageSize());
|
||||||
System.out.println(page.getTotal());
|
System.out.println(page.getTotal());
|
||||||
|
|||||||
@@ -31,12 +31,27 @@
|
|||||||
<if test="name!=null">
|
<if test="name!=null">
|
||||||
p.name like concat(concat('%',#{name}),'%')
|
p.name like concat(concat('%',#{name}),'%')
|
||||||
</if>
|
</if>
|
||||||
|
order by locate(#{name},p.name)
|
||||||
</where>
|
</where>
|
||||||
<if test=" null!= pageSize ">
|
<if test=" null!= pageSize ">
|
||||||
limit ${(current-1) * pageSize},${pageSize}
|
limit ${(current-1) * pageSize},${pageSize}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="countPositionAndRole" resultType="java.lang.Integer">
|
||||||
|
select count(1) from ts_position p
|
||||||
|
left join ts_position_role pr
|
||||||
|
on p.id=pr.position_id
|
||||||
|
left join ts_role r
|
||||||
|
on pr.role_id=r.id
|
||||||
|
<where>
|
||||||
|
<if test="name!=null">
|
||||||
|
p.name like concat(concat('%',#{name}),'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="pageTotal" resultType="Long">
|
<select id="pageTotal" resultType="Long">
|
||||||
select count(1) as total from ts_position
|
select count(1) as total from ts_position
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user