# sqltemplate **Repository Path**: harryStyle/sqltemplate ## Basic Information - **Project Name**: sqltemplate - **Description**: 动态拼接sql,类似mybatis代理模式通过配置xml模板动态生成sql,本项目适用于不支持JDBC链接但支持sql的数据库来动态生成sql,也可用于其他使用模板动态生成语句场景。再也不用担心sql或其他语句与代码耦合在一块的问题了。 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 3 - **Created**: 2020-09-20 - **Last Updated**: 2025-06-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sqltemplate #### 介绍 动态拼接sql,类似mybatis代理模式通过配置xml模板动态生成sql,本项目适用于不支持JDBC链接但支持sql的数据库来动态生成sql,也可用于其他使用模板动态生成语句场景。再也不用担心sql或其他语句与代码耦合在一块的问题了。 #### 使用说明 配置: sql.template.locations = xml文件位置,可使用通配符 使用流程: 1、创建或注入SqlTemplateFactory; 2、通过SqlTemplateFactory获取sql模板; 3、通过sql模板对象处理sql。 示例: @Autowired private SqlTemplateFactory sqlTemplateFactory; SqlTemplate updateUserTemplate = sqlTemplateFactory.getTemplate("user.updateUser"); Map map = new HashMap<>(); map.put("id", "1"); SqlMeta process = updateUserTemplate.process(map); 联系邮箱:li1210451792@163.com #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)