java - 根据月份查询多个表里的内容怎么实现好?
大家讲道理
大家讲道理 2017-04-18 10:47:55
0
1
519

有12个一样结构的表,分别记录十二个月份的相关信息。
用户可以选择起始月份,结束月份,查询信息。表名类似XXXX_2017_01,XXXX_2017_12这样,
我得先根据用户传入的月份拼接表名,再用UNION ALL进行查询?但是查询出来的LIST里面就不知道每条记录是属于哪个表的了。
MYBATIS应该怎么写好?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
巴扎黑

1. If you don’t consider sql injection, you can search the difference between #{} and ${} on Baidu, then upgrade the sql statement to the business level and treat it as business processing. After splicing, use ${} to pass it into the atomic layer

2. Checked 12 times

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!