Commit 22ffd63e authored by libin's avatar libin

通用配置

parent 14d190f6
......@@ -27,15 +27,20 @@ import java.util.Map;
* @date 2019-06-03 15:57:13
*/
@Service
public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
public class CofigBiz extends BaseBiz<CofigMapper, Cofig> {
public List<Cofig> getConfigByType(List<Integer> list){
return mapper.getAllByType(list);
public List<Cofig> getConfigByType(List<Integer> list) {
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0);
criteria.andIn("type", list);
return mapper.selectByExample(example);
}
/**
* 修改配置
*
* @param cofig
* @return
*/
......@@ -46,17 +51,17 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
}
@Cache(key = "app:withdrawrule:88")
public WithDrawRuleVo getWithDrawRule(){
public WithDrawRuleVo getWithDrawRule() {
WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo();
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("type",88);
criteria.andEqualTo("type", 88);
List<Cofig> cofigs = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(cofigs)){
if (CollectionUtils.isEmpty(cofigs)) {
return withDrawRuleVo;
}
Cofig cofig = cofigs.get(0);
withDrawRuleVo = JSON.parseObject(cofig.getParams(),WithDrawRuleVo.class);
withDrawRuleVo = JSON.parseObject(cofig.getParams(), WithDrawRuleVo.class);
withDrawRuleVo.setDescription(cofig.getValue());
return withDrawRuleVo;
}
......@@ -72,10 +77,10 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
Query query = new Query(params);
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
criteria.andEqualTo("isDel", 0);
PageDataVO<Cofig> cofigPage = PageDataVO.pageInfo(query.getPage(), query.getLimit(), () -> mapper.selectByExample(example));
return new TableResultResponse<>(cofigPage.getTotalCount(),cofigPage.getData()) ;
return new TableResultResponse<>(cofigPage.getTotalCount(), cofigPage.getData());
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment