@Override
public TableDataInfo<TechnologyAwardsVo> queryPageList(TechnologyAwardsBo bo, PageQuery pageQuery) {
QueryWrapper<TechnologyAwardsVo> wrapper = Wrappers.query();
wrapper.eq(bo.getAwardLevel() != null, "t.award_level", bo.getAwardLevel())
.eq(bo.getAwardGrade() != null, "t.award_grade", bo.getAwardGrade())
.like(StrUtil.isNotBlank(bo.getAwardName()), "t.award_name", bo.getAwardName())
.like(StrUtil.isNotBlank(bo.getProjectName()), "t.project_name", bo.getProjectName())
.like(StrUtil.isNotBlank(bo.getAwardeeName()), "t.awardeeLabel", bo.getAwardeeName())
.le(bo.getParams().get("beginAwardeeTime") != null, "t.awardee_time", bo.getParams().get("beginAwardeeTime"))
.ge(bo.getParams().get("endAwardeeTime") != null, "t.awardee_time", bo.getParams().get("endAwardeeTime"))
.orderByDesc("t.create_time");
// .and(w -> w.ne("r.role_id", user.getRoleId()).or().isNull("r.role_id"))
// .notIn(CollUtil.isNotEmpty(userIds), "u.user_id", userIds)
// .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
// .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber());
Page<TechnologyAwardsVo> page = baseMapper.getTechnologyAwards(pageQuery.build(), wrapper);
return TableDataInfo.build(page);
public interface TechnologyAwardsMapper extends BaseMapperPlus<TechnologyAwardsMapper, TechnologyAwards, TechnologyAwardsVo> {
@DataPermission({
@DataColumn(key = "userName", value = "t.user_id")
})
Page<TechnologyAwardsVo> getTechnologyAwards(@Param("page") Page<TechnologyAwardsVo> page, @Param(Constants.WRAPPER) Wrapper<TechnologyAwardsVo> queryWrapper);
}
<select id="getTechnologyAwards" resultType="com.ruoyi.biz.domain.vo.TechnologyAwardsVo">
SELECT
*
FROM
(
SELECT DISTINCT
ANY_VALUE ( a.id ) id,
ANY_VALUE ( a.award_level ) award_level,
ANY_VALUE ( a.award_grade ) award_grade,
ANY_VALUE ( a.award_name ) award_name,
ANY_VALUE ( a.project_name ) project_name,
(
SELECT
GROUP_CONCAT( NAME )
FROM
biz_employee
WHERE
id IN ( SELECT emp_id FROM biz_technology_awards_emp WHERE technology_awards_id = a.id )) awardeeLabel,
ANY_VALUE ( d.dept_name ) awardeeUnitLabel,
ANY_VALUE ( a.awardee_time ) awardee_time,
ANY_VALUE ( a.create_time ) create_time,
ANY_VALUE ( a.user_id ) user_id
FROM
`biz_technology_awards` a
LEFT JOIN sys_dept d ON a.dept_id = d.dept_id
LEFT JOIN biz_technology_awards_emp ae ON a.id = ae.technology_awards_id
LEFT JOIN biz_employee e ON ae.emp_id = e.id
) t
${ew.getCustomSqlSegment}
</select>