package cn.newfeifan.mall.module.system.dal.mysql.wechatmsgtemplate;


import cn.newfeifan.mall.framework.common.pojo.PageResult;
import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.newfeifan.mall.module.system.controller.admin.wechatmsgtemplate.vo.WechatMsgTemplatePageReqVO;
import cn.newfeifan.mall.module.system.dal.dataobject.wechatmsgtemplate.WechatMsgTemplateDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 微信消息模板 Mapper
 *
 * @author 非繁人
 */
@Mapper
public interface WechatMsgTemplateMapper extends BaseMapperX<WechatMsgTemplateDO> {

    default PageResult<WechatMsgTemplateDO> selectPage(WechatMsgTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WechatMsgTemplateDO>()
                .eqIfPresent(WechatMsgTemplateDO::getWechatMsgTemplateId, reqVO.getWechatMsgTemplateId())
                .eqIfPresent(WechatMsgTemplateDO::getRemark, reqVO.getRemark())
                .eqIfPresent(WechatMsgTemplateDO::getMessageTemplateParameters, reqVO.getMessageTemplateParameters())
                .betweenIfPresent(WechatMsgTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WechatMsgTemplateDO::getId));
    }

}