package com.zt.plat.module.qms.business.config.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 手写签名配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigUserSignatureMapper extends BaseMapperX<ConfigUserSignatureDO> {

    default PageResult<ConfigUserSignatureDO> selectPage(ConfigUserSignaturePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigUserSignatureDO>()
                .eqIfPresent(ConfigUserSignatureDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ConfigUserSignatureDO::getUserName, reqVO.getUserName())
                .eqIfPresent(ConfigUserSignatureDO::getFileId, reqVO.getFileId())
                .eqIfPresent(ConfigUserSignatureDO::getSignatureContent, reqVO.getSignatureContent())
                .eqIfPresent(ConfigUserSignatureDO::getCancelFlag, reqVO.getCancelFlag())
                .eqIfPresent(ConfigUserSignatureDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigUserSignatureDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigUserSignatureDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigUserSignatureDO::getId));
    }

}