无极低码 :https://wheart.cn
无极低码SQL模板使用教程
一、模板结构与规则
无极低码SQL模板通过简洁的Markdown格式,使SQL语句具有更强的灵活性和适应性,简化了根据业务需求定制SQL的过程。
无极低码SQL模板是一种基于Markdown格式的特殊SQL语句表示方式,它利用∮
符号作为动态条件的标识符,使得SQL语句能够在运行时根据变量值动态生成。
下面是无极低码SQL模板的一般结构:
select方法名,用于定位执行语句
===分隔符
sql语句,为查询输出前端的值,where 1=1 结束 也可以直接跟参数
∮bypositioncode为动态参数
与下一个sql之间使用“;”分割
∮byIn_id表示非空时拼接如下sql
and id in('#byIn_id#')“#byIn_id#”会被替换为实际值
动态拼接时间查询条件
∮bystartpubTime&&byendpubTime
and pub_time between '#bystartpubTime#' and '#byendpubTime#'
动态拼接模糊查询
∮byname
and name like'%#byname#%'
二、动态条件的应用
- 对于每个
∮
开头的条件行,如果关联的变量存在且非空,那么该行条件将被包含在最终执行的SQL查询中。 - 如果变量不存在或为空,则对应的SQL条件将被忽略。
三、示例sql模板
select
===
select positioncode ,id,positionname,picurl ,pichref ,pictitle ,picdes ,sort from travelpositionpics where 1=1
∮bypositioncode
and positioncode=#bypositioncode#
∮bypositionname
and positionname='#bypositionname#'
∮bypicurl
and picurl='#bypicurl#'
∮bypichref
and pichref='#bypichref#'
∮bypictitle
and pictitle='#bypictitle#'
∮bypicdes
and picdes='#bypicdes#'
∮bysort
and sort=#bysort#
;
selectOneByid
===
select positioncode ,picurl ,pichref ,pictitle ,picdes ,sort from travelpositionpics where 1=1
∮bypositioncode
and positioncode=#bypositioncode#
∮bypicurl
and picurl='#bypicurl#'
∮bypichref
and pichref='#bypichref#'
∮bypictitle
and pictitle='#bypictitle#'
∮bypicdes
and picdes='#bypicdes#'
∮bysort
and sort=#bysort#
;
delete
===
delete from travelpositionpics where 1=1
∮bypositioncode
and positioncode=#bypositioncode#
∮bypicurl
and picurl='#bypicurl#'
∮bypichref
and pichref='#bypichref#'
∮bypictitle
and pictitle='#bypictitle#'
∮bypicdes
and picdes='#bypicdes#'
∮bysort
and sort=#bysort#
∮byIn_id
and id in('#byIn_id#')
;
insert
===
insert ignore into travelpositionpics(positioncode,positionname,picurl,pichref,pictitle,picdes,sort)
VALUES(#positioncode#,'#positionname#','∮#picurl#','#pichref#','#pictitle#','#picdes#',#sort#);
update
===
update travelpositionpics set
∮positioncode
positioncode=#positioncode#,
∮positionname
positionname='#positionname#',
∮picurl
picurl='#picurl#',
∮pichref
pichref='#pichref#',
∮pictitle
pictitle='#pictitle#',
∮picdes
picdes='#picdes#',
∮sort
sort=#sort#
where 1=1
∮bypositioncode
and positioncode='#bypositioncode#'
∮bypicurl
and picurl='#bypicurl#'
∮bypichref
and pichref='#bypichref#'
∮bypictitle
and pictitle='#bypictitle#'
∮bypicdes
and picdes='#bypicdes#'
∮byid
and id=#byid#
∮bysort
and sort='#bysort#'
无极低码 :https://wheart.cn
-
2025-02-09 17:42:55.0
deepseek,人工智能,ai,效率工具
-
2025-01-12 15:38:12.0
GIS,等值面,绘图,地图,一张图
-
2024-12-02 17:10:20.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-25 21:43:11.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-25 20:09:53.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-22 13:58:39.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-22 13:57:40.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-22 13:54:42.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-22 13:53:44.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-10-22 13:52:15.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-08-10 18:54:34.0
无极低码,项目实战,软件产品,项目开发
-
2024-08-06 09:14:50.0
AI,人工智能,AIGC
-
2024-05-30 09:34:32.0
treejs,3D,echart,三维,炫酷,网页,三维可视化
-
2024-04-23 21:27:03.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-04-20 08:54:12.0
echart,排名,柱状图,可视化,示例
-
2024-04-16 20:54:29.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-04-06 17:03:18.0
低代码,无极低码,低代码编程,低代码开发平台,操作指南
-
2024-04-04 17:21:12.0
低代码,无极低码,低代码编程,低代码开发平台,操作指南
-
2024-04-03 21:10:32.0
无极低码,低代码平台,零代码开发,快速开发平台,操作指南,部署指南
-
2024-03-24 21:41:39.0
无极低码,低代码平台,零代码开发,快速开发平台,操作指南,部署指南
-
2024-03-20 22:15:44.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-03-05 21:07:13.0
低代码,无极低码,低代码编程,低代码开发平台
-
2024-03-03 22:08:20.0
低代码,无极低码,低代码编程
-
2024-03-03 21:47:31.0
低代码,无极低码,低代码编程
-
2024-03-03 21:40:23.0
低代码,无极低码,低代码编程
-
2024-03-03 18:58:23.0
低代码,无极低码,低代码编程
-
2024-03-03 18:52:59.0
低代码,无极低码,低代码编程
-
2024-03-03 18:45:33.0
低代码,无极低码,低代码编程
-
2024-03-03 16:20:18.0
无极低码,低代码平台,零代码开发,快速开发平台,操作指南,部署指南