Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreampie/jfinal-sqlinxml
jfinal sql in xml plugin
https://github.com/dreampie/jfinal-sqlinxml
Last synced: about 2 months ago
JSON representation
jfinal sql in xml plugin
- Host: GitHub
- URL: https://github.com/dreampie/jfinal-sqlinxml
- Owner: Dreampie
- Created: 2014-09-10T06:55:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-05T07:32:09.000Z (about 10 years ago)
- Last Synced: 2024-08-05T19:35:50.972Z (5 months ago)
- Language: Java
- Size: 130 KB
- Stars: 10
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jfinal-sqlinxml
============jfinal sqlinxml plugin,查看其他插件-> [Maven](http://search.maven.org/#search%7Cga%7C1%7Ccn.dreampie)
maven 引用 ${jfinal-sqlinxml.version}替换为相应的版本如:0.1
```xml
cn.dreampie
jfinal-sqlinxml
${jfinal-sqlinxml.version}```
启用插件
```java
//sql语句plugin
plugins.add(new SqlInXmlPlugin());```
sql文件以 xx_sql.xml结尾
```xml
SELECT `user`.*,`userInfo`.street street,`userInfo`.gender gender,
`userInfo`.zip_code zip_code,`province`.name province,`city`.name city,`county`.name
county,`userRole`.role_id role_id
FROM sec_user `user` LEFT JOIN sec_user_info `userInfo`
ON(`user`.id=`userInfo`.id)
LEFT JOIN sec_user_role `userRole` ON(`user`.id=`userRole`.user_id)
LEFT JOIN com_area `province` ON(`userInfo`.province_id=`province`.id) LEFT JOIN com_area `city`
ON(`userInfo`.city_id=`city`.id) LEFT JOIN com_area `county`
ON(`userInfo`.county_id=`county`.id) LEFT JOIN sec_user_role `userRole` ON
(`user`.id=`userRole`.user_id)
FROM sec_role `role` WHERE `role`.id IN (SELECT `userRole`.role_id FROM
sec_user_role `userRole` WHERE `userRole`.user_id=?)
FROM sec_permission `permission` WHERE `permission`.id IN (SELECT
`role_permission`.permission_id FROM sec_role_permission
`role_permission` WHERE `role_permission`.role_id=?)
```
获取sql内容
```java
//group+id
SqlKit.sql("user.findInfoBySelect")```