feat(后台管理): 关键字管理

添加关键字菜单基础代码
master
wayn 4 years ago
parent 08bf5a0170
commit b0a18a5ec4

@ -26,7 +26,7 @@ public class AdminOrderController extends BaseController {
@GetMapping("list")
public R list(Order order) {
Page<Order> page = getPage();
return R.success().add("page", iAdminOrderService.selectListPage(page, order));
return R.success().add("page", iAdminOrderService.listPage(page, order));
}
@GetMapping("{orderId}")

@ -0,0 +1,33 @@
package com.wayn.admin.api.controller.shop;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wayn.common.base.controller.BaseController;
import com.wayn.common.core.domain.shop.Keyword;
import com.wayn.common.core.service.shop.IKeywordService;
import com.wayn.common.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
*
* </p>
*
* @author wayn
* @since 2020-10-03
*/
@RestController
@RequestMapping("shop/keyword")
public class KeywordController extends BaseController {
@Autowired
private IKeywordService iKeywordService;
@GetMapping("list")
public R list(Keyword keyword) {
Page<Keyword> page = getPage();
return R.success().add("page", iKeywordService.listPage(page, keyword));
}
}

@ -2,6 +2,7 @@ package com.wayn.common.core.domain.shop;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -17,6 +18,7 @@ import java.time.LocalDateTime;
* @since 2020-11-02
*/
@Data
@TableName("shop_keyword")
@EqualsAndHashCode(callSuper = false)
public class Keyword implements Serializable {

@ -1,5 +1,7 @@
package com.wayn.common.core.mapper.shop;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wayn.common.core.domain.shop.Keyword;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface KeywordMapper extends BaseMapper<Keyword> {
IPage<Keyword> selectKeywordListPage(Page<Keyword> page, Keyword keyword);
}

@ -23,7 +23,7 @@ public interface IAdminOrderService extends IService<Order> {
* @param order
* @return r
*/
IPage<Order> selectListPage(IPage<Order> page, Order order);
IPage<Order> listPage(IPage<Order> page, Order order);
/**
* 退

@ -1,7 +1,9 @@
package com.wayn.common.core.service.shop;
import com.wayn.common.core.domain.shop.Keyword;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wayn.common.core.domain.shop.Keyword;
/**
* <p>
@ -13,4 +15,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IKeywordService extends IService<Keyword> {
/**
*
*
* @param page
* @param keyword
* @return
*/
IPage<Keyword> listPage(Page<Keyword> page, Keyword keyword);
}

@ -51,7 +51,7 @@ public class AdminOrderServiceImpl extends ServiceImpl<AdminOrderMapper, Order>
private IMailConfigService mailConfigService;
@Override
public IPage<Order> selectListPage(IPage<Order> page, Order order) {
public IPage<Order> listPage(IPage<Order> page, Order order) {
return adminOrderMapper.selectOrderListPage(page, order);
}

@ -1,9 +1,12 @@
package com.wayn.common.core.service.shop.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wayn.common.core.domain.shop.Keyword;
import com.wayn.common.core.mapper.shop.KeywordMapper;
import com.wayn.common.core.service.shop.IKeywordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -17,4 +20,11 @@ import org.springframework.stereotype.Service;
@Service
public class KeywordServiceImpl extends ServiceImpl<KeywordMapper, Keyword> implements IKeywordService {
@Autowired
private KeywordMapper keywordMapper;
@Override
public IPage<Keyword> listPage(Page<Keyword> page, Keyword keyword) {
return keywordMapper.selectKeywordListPage(page, keyword);
}
}

@ -3,7 +3,7 @@
<mapper namespace="com.wayn.common.core.mapper.shop.KeywordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.wayn.common.core.domain.shop.Keyword">
<resultMap id="ShopKeywordResult" type="com.wayn.common.core.domain.shop.Keyword">
<result column="id" property="id" />
<result column="keyword" property="keyword" />
<result column="jump_type" property="jumpType" />
@ -17,10 +17,27 @@
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
<sql id="selectKeywordVo">
select id,
keyword, jump_type, url, is_hot, is_default, sort_order, create_time, update_time, del_flag
from shop_keyword
</sql>
<select id="selectKeywordListPage" resultType="com.wayn.common.core.domain.shop.Keyword">
<include refid="selectKeywordVo"/>
<where>
del_flag = 0
<if test="keyword != null and keyword != ''">
AND keyword like concat('%', #{keyword}, '%')
</if>
<if test="is_hot != null">
AND is_hot = #{isHot}
</if>
<if test="is_default != null">
AND is_default = #{isDefault}
</if>
</where>
order by sort_order desc, create_time desc
</select>
</mapper>

Loading…
Cancel
Save