10 files modified
2 files added
| | |
| | | public Result list(@RequestBody @Valid AdListDto adListDto) { |
| | | Page<CmsAdInfoEntity> page = new Page<>(adListDto.getPageNum(), adListDto.getPageSize()); |
| | | UserEntity user = LoginUserUtil.getLoginUser(); |
| | | QueryWrapper<CmsAdInfoEntity> query = new QueryWrapper<>(); |
| | | query.eq("company_id", user.getCompanyId()); |
| | | CmsAdInfoEntity cmsAdInfoEntity = new CmsAdInfoEntity(); |
| | | cmsAdInfoEntity.setCompanyId(user.getCompanyId()); |
| | | |
| | | return Result.ok("获取成功", cmsAdInfoService.page(page, query)); |
| | | return Result.ok("获取成功", cmsAdInfoService.findInPage(page, cmsAdInfoEntity)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据ID获取信息") |
| | |
| | | @PostMapping(value = "/list") |
| | | public Result list(@RequestBody @Valid FriendlyInfoListDto friendlyInfoListDto) { |
| | | UserEntity user = LoginUserUtil.getLoginUser(); |
| | | QueryWrapper<CmsAdInfoEntity> query = new QueryWrapper<>(); |
| | | query.eq("company_id", user.getCompanyId()); |
| | | |
| | | CmsFriendlyLinkEntity friendlyLink = new CmsFriendlyLinkEntity(); |
| | | friendlyLink.setCompanyId(user.getCompanyId()); |
| | | Page<CmsFriendlyLinkEntity> page = new Page<>(friendlyInfoListDto.getPageNum(), friendlyInfoListDto.getPageSize()); |
| | | return Result.ok("获取成功", cmsFriendlyLinkService.page(page)); |
| | | return Result.ok("获取成功", cmsFriendlyLinkService.findInPage(page, friendlyLink)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据ID获取信息") |
| | |
| | | package com.xcong.farmer.cms.modules.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xcong.farmer.cms.common.system.base.BaseEntity; |
| | | import lombok.Data; |
| | |
| | | private String remark; |
| | | |
| | | private Long companyId; |
| | | |
| | | @TableField(exist = false) |
| | | private String groupName; |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xcong.farmer.cms.common.system.base.BaseEntity; |
| | | import lombok.Data; |
| | |
| | | private String remark; |
| | | |
| | | private Long companyId; |
| | | |
| | | @TableField(exist = false) |
| | | private String groupName; |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CmsAdInfoMapper extends BaseMapper<CmsAdInfoEntity> { |
| | | |
| | | Page<CmsAdInfoEntity> selectInPage(Page<CmsAdInfoEntity> page, @Param("record") CmsAdInfoEntity cmsAdInfoEntity); |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsFriendlyLinkEntity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CmsFriendlyLinkMapper extends BaseMapper<CmsFriendlyLinkEntity> { |
| | | |
| | | Page<CmsFriendlyLinkEntity> selectInPage(Page<CmsFriendlyLinkEntity> page, @Param("record") CmsFriendlyLinkEntity cmsFriendlyLinkEntity); |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | public interface ICmsAdInfoService extends IService<CmsAdInfoEntity> { |
| | | |
| | | Page<CmsAdInfoEntity> findInPage(Page<CmsAdInfoEntity> page, CmsAdInfoEntity cmsAdInfoEntity); |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsFriendlyLinkEntity; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CmsFriendlyLinkMapper; |
| | | |
| | | public interface ICmsFriendlyLinkService extends IService<CmsFriendlyLinkEntity> { |
| | | |
| | | Page<CmsFriendlyLinkEntity> findInPage(Page<CmsFriendlyLinkEntity> page, CmsFriendlyLinkEntity cmsFriendlyLinkEntity); |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.service.Impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CmsAdInfoMapper; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class CmsAdInfoServiceImpl extends ServiceImpl<CmsAdInfoMapper, CmsAdInfoEntity> implements ICmsAdInfoService { |
| | | @Override |
| | | public Page<CmsAdInfoEntity> findInPage(Page<CmsAdInfoEntity> page, CmsAdInfoEntity cmsAdInfoEntity) { |
| | | return this.baseMapper.selectInPage(page, cmsAdInfoEntity); |
| | | } |
| | | } |
| | |
| | | package com.xcong.farmer.cms.modules.system.service.Impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsFriendlyLinkEntity; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CmsFriendlyLinkMapper; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class CmsFriendlyLinkServiceImpl extends ServiceImpl<CmsFriendlyLinkMapper, CmsFriendlyLinkEntity> implements ICmsFriendlyLinkService { |
| | | |
| | | @Override |
| | | public Page<CmsFriendlyLinkEntity> findInPage(Page<CmsFriendlyLinkEntity> page, CmsFriendlyLinkEntity cmsFriendlyLinkEntity) { |
| | | return this.baseMapper.selectInPage(page, cmsFriendlyLinkEntity); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xcong.farmer.cms.modules.system.mapper.CmsAdInfoMapper"> |
| | | |
| | | <select id="selectInPage" resultType="com.xcong.farmer.cms.modules.system.entity.CmsAdInfoEntity"> |
| | | select |
| | | a.*, |
| | | b.name groupName |
| | | from cms_ad_info a |
| | | left join cms_group_info b on a.group_id=b.id |
| | | where a.company_id=#{record.companyId} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xcong.farmer.cms.modules.system.mapper.CmsFriendlyLinkMapper"> |
| | | |
| | | <select id="selectInPage" resultType="com.xcong.farmer.cms.modules.system.entity.CmsFriendlyLinkEntity"> |
| | | select |
| | | a.*, |
| | | b.name groupName |
| | | from cms_friendly_link a |
| | | left join cms_group_info b on a.group_id=b.id |
| | | where a.company_id=#{record.companyId} |
| | | </select> |
| | | |
| | | </mapper> |