package org.jeecg.modules.applyForm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.utils.StringUtils;
import org.jeecg.modules.applyForm.entity.ApplyForm;
import org.jeecg.modules.applyForm.mapper.ApplyFormMapper;
import org.jeecg.modules.applyForm.service.IApplyFormService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: apply_form
 * @Author: jeecg-boot
 * @Date:   2021-08-23
 * @Version: V1.0
 */
@Service
public class ApplyFormServiceImpl extends ServiceImpl<ApplyFormMapper, ApplyForm> implements IApplyFormService {

   @Override
   public ApplyForm getAppleyFormByFormKey(String formKey) {

      LambdaQueryWrapper<ApplyForm> wa = new LambdaQueryWrapper<>();
      wa.eq(StringUtils.isNotEmpty(formKey), ApplyForm::getFormKey,formKey)
      .eq(ApplyForm::getStatus,1);
      ApplyForm applyForm = getOne(wa);

      return applyForm;
   }
}
