<%_ if (position === 'import') { _%>
import <%= packageName %>.SpringBootUtil;
import <%= packageName %>.system.domain.FormSaveData;
import <%= packageName %>.system.repository.FormSaveDataRepository;
  <%_ if (ormTool === 'mybatis') { _%>
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  <%_ } else { _%>
  <%_ } _%>
<%_ } _%>
<%_ if (position === 'method') { _%>
    <%_ if (ormTool === 'mybatis') { _%>

    public List<String> getFormDataByKey(String formKey) {
        FormConfig formConfig = this.baseMapper.selectOne(new LambdaQueryWrapper<FormConfig>().eq(FormConfig::getFormKey, formKey));
        if (Objects.isNull(formConfig)) {
            return new ArrayList<>();
        }
        FormSaveDataRepository saveDataRepository = SpringBootUtil.getBean(FormSaveDataRepository.class);
        List<FormSaveData> formDataList = saveDataRepository.selectList(new LambdaQueryWrapper<FormSaveData>().eq(FormSaveData::getFormConfigId, formConfig.getId()));
        return formDataList.stream().map(FormSaveData::getFormData).toList();
    }
    <%_ } else { _%>
    <%_ } _%>
<%_ } _%>
