feat(mapper): 添加StatementType配置以支持动态SQL执行

- 在JeeLowCodeSqlMapper接口中引入StatementType配置-为selectData方法添加@Options注解并设置statementType为STATEMENT
-为selectPageData方法添加@Options注解并设置statementType为STATEMENT
- 引入org.apache.ibatis.mapping.StatementType包以支持新功能
- 此变更使得Mapper能够正确处理动态生成的SQL语句
This commit is contained in:
2025-11-12 17:07:03 +08:00
parent ddcf86df68
commit 6a640020f6

View File

@@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.Master;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jeelowcode.framework.tenant.annotation.JeeLowCodeTenantIgnore; import com.jeelowcode.framework.tenant.annotation.JeeLowCodeTenantIgnore;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.StatementType;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -24,11 +25,13 @@ public interface JeeLowCodeSqlMapper {
//获取数据 - 多个 //获取数据 - 多个
@DS(value = "#dataSourceType") @DS(value = "#dataSourceType")
@Select("${jeeLowCodeSelectSql}") @Select("${jeeLowCodeSelectSql}")
@Options(statementType = StatementType.STATEMENT)
List<Map<String, Object>> selectData(@Param("dataSourceType") String dataSourceType,@Param("jeeLowCodeSelectSql") String jeeLowCodeSelectSql,@Param("ew") Map<String,Object> ew); List<Map<String, Object>> selectData(@Param("dataSourceType") String dataSourceType,@Param("jeeLowCodeSelectSql") String jeeLowCodeSelectSql,@Param("ew") Map<String,Object> ew);
//分页 //分页
@DS(value = "#dataSourceType") @DS(value = "#dataSourceType")
@Select("${jeeLowCodeSelectSql}") @Select("${jeeLowCodeSelectSql}")
@Options(statementType = StatementType.STATEMENT)
IPage<Map<String, Object>> selectPageData(@Param("dataSourceType") String dataSourceType,IPage page,@Param("jeeLowCodeSelectSql") String jeeLowCodeSelectSql,@Param("ew") Map<String,Object> ew); IPage<Map<String, Object>> selectPageData(@Param("dataSourceType") String dataSourceType,IPage page,@Param("jeeLowCodeSelectSql") String jeeLowCodeSelectSql,@Param("ew") Map<String,Object> ew);
//新增数据 //新增数据