Commit f2b787a3 by Java-张振楠

修改SQL,以适配融创oracle数据库

parent a825becc
......@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLDecoder;
import java.util.List;
/**
......@@ -99,7 +100,7 @@ public class ReportToPdfController extends BaseController {
Paragraph paragraphPath1 = new Paragraph();
if (list != null && list.size() != 0) {
for (ReportAttachmentEntity reportAttachmentEntity : list) {
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentPath(),urlfont);
Chunk chunk = new Chunk(URLDecoder.decode(URLDecoder.decode(reportAttachmentEntity.getAttachmentPath().substring(reportAttachmentEntity.getAttachmentPath().lastIndexOf("/")))),urlfont);
paragraphPath1.add(chunk);
paragraphPath1.add(Chunk.NEWLINE);
}
......
......@@ -7,6 +7,8 @@ import java.util.List;
import javax.validation.constraints.NotNull;
import com.ejweb.conf.GConstants;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.validator.constraints.Length;
import com.ejweb.core.persistence.TreeEntity;
......@@ -37,7 +39,13 @@ public class Office extends TreeEntity<Office> {
private User primaryPerson;//主负责人
private User deputyPerson;//副负责人
private List<String> childDeptList;//快速添加子部门
/**
* 获取数据库名称
*/
@JsonIgnore
public String getDbName(){
return GConstants.getValue("jdbc.type");
}
public Office(){
super();
// this.sort = 30;
......
......@@ -3,7 +3,7 @@
#============================#
#\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e
productName=\u76d1\u5bdf\u4e3e\u62a5\u7ba1\u7406\u7cfb\u7edf
productName=\u76d1\u5bdf\u5ba1\u8ba1\u7ba1\u7406\u7cfb\u7edf
copyrightYear=2017
version=V1.2.6
......@@ -95,7 +95,7 @@ file.image.thumb.width=640
file.image.thumb.height=640
# The Prefix Url
#file.prefix.url=http://123.56.146.81:8808/
file.prefix.url=http://192.168.3.232:8080/
file.prefix.url=http://192.168.3.232:8081/
# The Prefix separator
file.upload.path.separator = /
......
......@@ -277,7 +277,8 @@
<select id="getOfficeList" resultType="Office">
SELECT
so.id AS "id",
CONCAT(so.name,'(',(SELECT s.name FROM ct_bbtc_sys_office s WHERE s.id = so.parent_id),')') AS "name"
<if test="dbName == 'oracle'">so.name||'('||(SELECT s.name FROM ct_bbtc_sys_office s WHERE s.id = so.parent_id)||')' AS "name"</if>
<if test="dbName == 'mysql'">CONCAT(so.name,'(',(SELECT s.name FROM ct_bbtc_sys_office s WHERE s.id = so.parent_id),')') AS "name"</if>
FROM ct_bbtc_sys_office so
WHERE so.type = '2'
</select>
......@@ -356,7 +357,7 @@
LEFT JOIN ct_bbtc_sys_user2role sur ON su.id = sur.user_id
LEFT JOIN ct_bbtc_sys_role sr ON sr.id = sur.role_id
WHERE
sr.name` = '系统管理员'
sr.name = '系统管理员'
</select>
<insert id="addRecord">
......@@ -388,7 +389,8 @@
AND create_date >= #{startDate}
</if>
<if test="endDate != null">
AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
</if>
GROUP BY report_status
</select>
......@@ -404,7 +406,8 @@
AND create_date >= #{startDate}
</if>
<if test="endDate != null">
AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
</if>
GROUP BY deal_result
</select>
......@@ -420,7 +423,8 @@
AND create_date >= #{startDate}
</if>
<if test="endDate != null">
AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
</if>
GROUP BY report_source
</select>
......@@ -436,7 +440,8 @@
AND create_date >= #{startDate}
</if>
<if test="endDate != null">
AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
</if>
GROUP BY supplement_type
</select>
......@@ -476,7 +481,8 @@
AND r.create_date >= #{startDate}
</if>
<if test="endDate != null">
AND r.create_date &lt;= CONCAT(#{endDate}," 23:59:59")
<if test="dbName == 'oracle'"> AND create_date &lt;= #{endDate}||" 23:59:59"</if>
<if test="dbName == 'mysql'"> AND create_date &lt;= CONCAT(#{endDate}," 23:59:59")</if>
</if>
order by r.create_date desc
limit 0,10
......
......@@ -44,6 +44,8 @@
<select id="getFileByPath" resultType="com.ejweb.modules.upload.entity.UploadEntity">
SELECT orientation FROM ct_bbtc_upload_files
WHERE #{path} LIKE CONCAT('%', path, '%')
WHERE #{path} LIKE
<if test="dbName == 'oracle'"> '%'|| path|| '%'</if>
<if test="dbName == 'mysql'"> CONCAT('%', path, '%')</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment