package com.yida.data.form.customForm.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.customform.CoreCustomFormGroup;
import com.yida.data.form.customForm.mapper.CoreCustomFormGroupMapper;
import com.yida.data.form.customForm.service.CoreCustomFormGroupService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Propagation;
import lombok.RequiredArgsConstructor;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


/**
 * 表单组 Service实现
 *
 * @author ccl
 * @date 2021-11-05 15:41:03
 */
@Service
@RequiredArgsConstructor
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class CoreCustomFormGroupServiceImpl extends ServiceImpl
        <CoreCustomFormGroupMapper, CoreCustomFormGroup> implements CoreCustomFormGroupService {

    private final CoreCustomFormGroupMapper coreCustomFormGroupMapper;



    @Override
    public Page<CoreCustomFormGroup> findGroupPageList(Integer pageNum,Integer pageSize,String groupName) {

        Page<CoreCustomFormGroup> groupPage = page(new Page<>(pageNum, pageSize), Wrappers.lambdaQuery(new CoreCustomFormGroup())
                .like(CoreCustomFormGroup::getGroupName, groupName)
                .orderByDesc(CoreCustomFormGroup::getCreateDate));

        return groupPage;
    }
}
