server层:
Wrapper<Ship> wrapper = new EntityWrapper<>();//条件类 wrapper.where("user_id={0}",uid);//增加条件 Page<Ship> shipPage = new Page<>(pageNum, pageSize);//分页类 List<Ship> ships = shipMapper.selectPages(shipPage, wrapper);//去dao return new PageResult<>(shipPage.getTotal(), ships);
daoMapper层:
List<Ship> selectPages(Page<Ship> page, @Param("ew") Wrapper<Ship> wrapper);
mapper.xml层:
<select id="selectPages" resultMap="BaseResultMap"> select s.*,f.fsa_flag from tb_ship s left join tb_flag_state_authority f on s.fsa_id=f."id" <where> ${ew.sqlSegment} </where> </select>