Merge branch 'ww' into test
This commit is contained in:
@@ -16,5 +16,7 @@ public interface TbShopExtendService extends IService<TbShopExtend> {
|
||||
|
||||
Map<String, Object> queryAll(TbShopExtendQueryCriteria criteria);
|
||||
|
||||
void saveInfo(TbShopExtend tbShopExtend);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbShopExtendMapper;
|
||||
@@ -41,5 +42,16 @@ public class TbShopExtendServiceImpl extends ServiceImpl<TbShopExtendMapper, TbS
|
||||
Page<TbShopExtend> ipage = tbShopExtendmapper.selectPage(page, wrapper);
|
||||
return PageUtil.toPage(ipage.getRecords(), ipage.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveInfo(TbShopExtend tbShopExtend) {
|
||||
QueryWrapper<TbShopExtend> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("shop_id", tbShopExtend.getShopId());
|
||||
wrapper.like("autokey",tbShopExtend.getAutokey());
|
||||
if(tbShopExtendmapper.exists(wrapper)){
|
||||
throw new BadRequestException("该自定义key已存在");
|
||||
}
|
||||
tbShopExtendmapper.insert(tbShopExtend);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user