前端:H5 首页增加 Banner 列表
This commit is contained in:
@@ -11,6 +11,8 @@ public interface BannerMapper {
|
||||
|
||||
BannerDO selectById(@Param("id") Integer id);
|
||||
|
||||
List<BannerDO> selectListByStatus(@Param("status") Integer status);
|
||||
|
||||
List<BannerDO> selectListByTitleLike(@Param("title") String title,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service // 实际上不用添加。添加的原因是,必须 Spring 报错提示
|
||||
@com.alibaba.dubbo.config.annotation.Service(validation = "true")
|
||||
@@ -27,6 +28,12 @@ public class BannerServiceImpl implements BannerService {
|
||||
@Autowired
|
||||
private BannerMapper bannerMapper;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BannerBO>> getBannerListByStatus(Integer status) {
|
||||
List<BannerDO> banners = bannerMapper.selectListByStatus(status);
|
||||
return CommonResult.success(BannerConvert.INSTANCE.convertToBO(banners));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<BannerPageBO> getBannerPage(BannerPageDTO bannerPageDTO) {
|
||||
BannerPageBO bannerPageBO = new BannerPageBO();
|
||||
|
||||
@@ -32,6 +32,18 @@
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectListByStatus" parameterType="Integer" resultType="BannerDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM banner
|
||||
<where>
|
||||
<if test="status != null">
|
||||
status = #{status}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectListByTitleLike" resultType="BannerDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
|
||||
Reference in New Issue
Block a user