| | |
| | | package com.mindskip.xzs.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | private String name; |
| | | |
| | | @TableField("dept_id") |
| | | private Integer deptId; |
| | | |
| | | @TableLogic |
| | | private Boolean deleted; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | | } |
| | |
| | | |
| | | private String name; |
| | | |
| | | private String deptName; |
| | | |
| | | private Boolean deleted; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mindskip.xzs.domain.Tag; |
| | | import com.mindskip.xzs.domain.UserTag; |
| | | import com.mindskip.xzs.domain.vo.TagVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<String> selectTagNamesByUserId(Integer id); |
| | | |
| | | List<String> selectCountById(Integer id); |
| | | |
| | | List<TagVO> page(@Param("tag") TagVO tag); |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public PageInfo<Tag> tagPage(TagVO tag) { |
| | | return PageHelper.startPage(tag.getPageIndex(), tag.getPageSize(), "id desc").doSelectPageInfo(() -> |
| | | new LambdaQueryChainWrapper<>(baseMapper) |
| | | .like(StringUtils.hasText(tag.getName()), Tag::getName, tag.getName()) |
| | | .list() |
| | | baseMapper.page(tag) |
| | | ); |
| | | } |
| | | |
| | |
| | | select user_name from t_user where id in (select user_id from t_user_tag where tag_id = #{id}) and deleted = 0 |
| | | </select> |
| | | |
| | | <select id="page" resultType="com.mindskip.xzs.domain.vo.TagVO"> |
| | | SELECT |
| | | tt.id, tt.name, td.name as deptName |
| | | FROM |
| | | t_tag tt |
| | | INNER JOIN t_department td ON tt.dept_id = td.id |
| | | <where> |
| | | AND tt.deleted = 0 |
| | | <if test="tag.name != null and tag.name != ''"> |
| | | AND tt.name like concat('%', #{tag.name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |