Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-sunac-report
sunac_report
Commits
2025ad5b
Commit
2025ad5b
authored
Sep 29, 2017
by
Java-张振楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置融创连接信息
parent
65095596
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
150 additions
and
149 deletions
+150
-149
BaseService.java
src/main/java/com/ejweb/core/service/BaseService.java
+3
-3
SsoDao.xml
src/main/resources/mappings/modules/front.sso/SsoDao.xml
+1
-1
UploadDao.xml
src/main/resources/mappings/modules/front.upload/UploadDao.xml
+2
-2
FrontReportDao.xml
src/main/resources/mappings/modules/front/report/FrontReportDao.xml
+3
-3
ReportDao.xml
src/main/resources/mappings/modules/report/ReportDao.xml
+19
-19
ReportAttachmentMapper.xml
src/main/resources/mappings/modules/reportAttachment/ReportAttachmentMapper.xml
+6
-6
AreaDao.xml
src/main/resources/mappings/modules/sys/AreaDao.xml
+9
-9
DictDao.xml
src/main/resources/mappings/modules/sys/DictDao.xml
+7
-7
LogDao.xml
src/main/resources/mappings/modules/sys/LogDao.xml
+5
-5
MenuDao.xml
src/main/resources/mappings/modules/sys/MenuDao.xml
+15
-15
OfficeDao.xml
src/main/resources/mappings/modules/sys/OfficeDao.xml
+15
-15
RoleDao.xml
src/main/resources/mappings/modules/sys/RoleDao.xml
+26
-26
UserDao.xml
src/main/resources/mappings/modules/sys/UserDao.xml
+29
-29
UploadDao.xml
src/main/resources/mappings/modules/upload/UploadDao.xml
+3
-2
ReportNoticeMapper.xml
src/main/resources/mappings/modules/workbench/ReportNoticeMapper.xml
+7
-7
No files found.
src/main/java/com/ejweb/core/service/BaseService.java
View file @
2025ad5b
...
...
@@ -72,7 +72,7 @@ public abstract class BaseService {
// if (StringUtils.isNotEmpty(officeIds)){
// sqlString.append(" OR " + oa + ".id IN ('" + officeIds + "')");
// }
sqlString
.
append
(
" OR EXISTS (SELECT 1 FROM sys_role_office WHERE role_id = '"
+
r
.
getId
()
+
"'"
);
sqlString
.
append
(
" OR EXISTS (SELECT 1 FROM
ct_bbtc_
sys_role_office WHERE role_id = '"
+
r
.
getId
()
+
"'"
);
sqlString
.
append
(
" AND office_id = "
+
oa
+
".id)"
);
}
//else if (Role.DATA_SCOPE_SELF.equals(r.getDataScope())){
...
...
@@ -169,7 +169,7 @@ public abstract class BaseService {
sqlString
.
append
(
" AND "
+
where
+
")"
);
}
else
if
(
Role
.
DATA_SCOPE_CUSTOM
.
equals
(
dataScopeString
)){
sqlString
.
append
(
" AND EXISTS (SELECT 1 FROM
sys_role_office ro123456,
sys_office o123456"
);
sqlString
.
append
(
" AND EXISTS (SELECT 1 FROM
ct_bbtc_sys_role_office ro123456, ct_bbtc_
sys_office o123456"
);
sqlString
.
append
(
" WHERE ro123456.office_id = o123456.id"
);
sqlString
.
append
(
" AND ro123456.role_id = '"
+
roleId
+
"'"
);
sqlString
.
append
(
" AND o123456."
+
where
+
")"
);
...
...
@@ -178,7 +178,7 @@ public abstract class BaseService {
// 生成个人权限SQL语句
for
(
String
where
:
StringUtils
.
split
(
userWheres
,
","
)){
if
(
Role
.
DATA_SCOPE_SELF
.
equals
(
dataScopeString
)){
sqlString
.
append
(
" AND EXISTS (SELECT 1 FROM sys_user"
);
sqlString
.
append
(
" AND EXISTS (SELECT 1 FROM
ct_bbtc_
sys_user"
);
sqlString
.
append
(
" WHERE id='"
+
user
.
getId
()
+
"'"
);
sqlString
.
append
(
" AND "
+
where
+
")"
);
}
...
...
src/main/resources/mappings/modules/front.sso/SsoDao.xml
View file @
2025ad5b
...
...
@@ -6,7 +6,7 @@
SELECT
count(*)
FROM
sys_user su
ct_bbtc_
sys_user su
WHERE
su.login_name = #{username}
</select>
...
...
src/main/resources/mappings/modules/front.upload/UploadDao.xml
View file @
2025ad5b
...
...
@@ -20,7 +20,7 @@
height
</sql>
<insert
id=
"addUploadFile"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO upload_files(
INSERT INTO
ct_bbtc_
upload_files(
<include
refid=
"fileColumns"
/>
) VALUES(
#{id},
...
...
@@ -45,7 +45,7 @@
<select
id=
"getUploadEntityByPath"
resultType=
"com.ejweb.modules.upload.entity.UploadEntity"
>
SELECT
<include
refid=
"fileColumns"
/>
FROM upload_files
FROM
ct_bbtc_
upload_files
WHERE path = #{code}
ORDER BY created DESC
limit 1
...
...
src/main/resources/mappings/modules/front/report/FrontReportDao.xml
View file @
2025ad5b
...
...
@@ -87,9 +87,9 @@
<select
id=
"getUser"
resultType=
"com.ejweb.modules.sys.entity.User"
>
SELECT u.id
FROM sys_user u
LEFT JOIN sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN sys_role r ON r.id = u2r.role_id
FROM
ct_bbtc_
sys_user u
LEFT JOIN
ct_bbtc_
sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN
ct_bbtc_
sys_role r ON r.id = u2r.role_id
WHERE r.enname = 'admin'
limit 1
</select>
...
...
src/main/resources/mappings/modules/report/ReportDao.xml
View file @
2025ad5b
...
...
@@ -113,9 +113,9 @@
<select
id=
"findRole"
parameterType=
"User"
resultType=
"String"
>
SELECT
sr.name AS "roleName"
FROM sys_role sr
LEFT JOIN sys_user2role sur ON sr.id = sur.role_id
LEFT JOIN sys_user su ON su.id = sur.user_id
FROM
ct_bbtc_
sys_role sr
LEFT JOIN
ct_bbtc_
sys_user2role sur ON sr.id = sur.role_id
LEFT JOIN
ct_bbtc_
sys_user su ON su.id = sur.user_id
WHERE su.id = #{id}
</select>
...
...
@@ -224,13 +224,13 @@
sp.position_name AS "position.name",
sr.`name` AS "role.name"
FROM
sys_user su
LEFT JOIN sys_office so1 ON so1.id = su.company_id
LEFT JOIN sys_office so2 ON so2.id = su.office_id
LEFT JOIN sys_user2position sup ON sup.user_id = su.id
LEFT JOIN sys_position sp ON sp.id = sup.position_id
LEFT JOIN sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id
ct_bbtc_
sys_user su
LEFT JOIN
ct_bbtc_
sys_office so1 ON so1.id = su.company_id
LEFT JOIN
ct_bbtc_
sys_office so2 ON so2.id = su.office_id
LEFT JOIN
ct_bbtc_
sys_user2position sup ON sup.user_id = su.id
LEFT JOIN
ct_bbtc_
sys_position sp ON sp.id = sup.position_id
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>
1 = 1
<if
test=
"no != null and no != ''"
>
...
...
@@ -273,8 +273,8 @@
<select
id=
"getOfficeList"
resultType=
"Office"
>
SELECT
so.id AS "id",
CONCAT(so.`name`,'(',(SELECT s.`name` FROM sys_office s WHERE s.id = so.parent_id),')') AS "name"
FROM sys_office so
CONCAT(so.`name`,'(',(SELECT s.`name` FROM
ct_bbtc_
sys_office s WHERE s.id = so.parent_id),')') AS "name"
FROM
ct_bbtc_
sys_office so
WHERE so.type = '2'
</select>
...
...
@@ -282,7 +282,7 @@
SELECT
so.id AS "id",
so.`name` AS "name"
FROM sys_office so
FROM
ct_bbtc_
sys_office so
WHERE so.type = '1'
</select>
...
...
@@ -290,7 +290,7 @@
SELECT
position_code AS "id",
position_name AS "positionName"
FROM sys_position
FROM
ct_bbtc_
sys_position
</select>
<insert
id=
"addReportNotice"
>
...
...
@@ -348,15 +348,15 @@
SELECT
su.id
FROM
sys_user su
LEFT JOIN sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id
ct_bbtc_
sys_user su
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` = '系统管理员'
</select>
<insert
id=
"addRecord"
>
INSERT INTO
report_exchange_history
(
INSERT INTO
ct_bbtc_report_exchange_his
(
id,
report_id,
old_user_id,
...
...
@@ -490,7 +490,7 @@
r.supplement_type AS "supplementType",
r.deal_person_name AS "dealPersonName",
r.deal_result AS "dealResult",
(CASE WHEN r.exchange_type='2' THEN (SELECT `name` FROM sys_user WHERE id=r.exchange_after_user) ELSE '--' END) AS "exchangeAfterUser",
(CASE WHEN r.exchange_type='2' THEN (SELECT `name` FROM
ct_bbtc_
sys_user WHERE id=r.exchange_after_user) ELSE '--' END) AS "exchangeAfterUser",
r.exchange_type AS "exchangeType"
FROM report r
<where>
...
...
src/main/resources/mappings/modules/reportAttachment/ReportAttachmentMapper.xml
View file @
2025ad5b
...
...
@@ -15,15 +15,15 @@
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from report_attachment
from
ct_bbtc_
report_attachment
where id = #{id,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from report_attachment
delete from
ct_bbtc_
report_attachment
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.ejweb.modules.reportAttachment.entity.ReportAttachment"
>
insert into
report_attachment (id, report_id, attachment_name,
insert into
ct_bbtc_report_attachment (id, report_id, attachment_name,
attachment_path, attachment_size, attachment_type
)
values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{attachmentName,jdbcType=VARCHAR},
...
...
@@ -31,7 +31,7 @@
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.ejweb.modules.reportAttachment.entity.ReportAttachment"
>
insert into report_attachment
insert into
ct_bbtc_
report_attachment
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
...
...
@@ -74,7 +74,7 @@
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.ejweb.modules.reportAttachment.entity.ReportAttachment"
>
update report_attachment
update
ct_bbtc_
report_attachment
<set
>
<if
test=
"reportId != null"
>
report_id = #{reportId,jdbcType=VARCHAR},
...
...
@@ -95,7 +95,7 @@
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.ejweb.modules.reportAttachment.entity.ReportAttachment"
>
update report_attachment
update
ct_bbtc_
report_attachment
set report_id = #{reportId,jdbcType=VARCHAR},
attachment_name = #{attachmentName,jdbcType=VARCHAR},
attachment_path = #{attachmentPath,jdbcType=VARCHAR},
...
...
src/main/resources/mappings/modules/sys/AreaDao.xml
View file @
2025ad5b
...
...
@@ -20,13 +20,13 @@
</sql>
<sql
id=
"areaJoins"
>
LEFT JOIN sys_office p ON p.id = a.parent_id
LEFT JOIN
ct_bbtc_
sys_office p ON p.id = a.parent_id
</sql>
<select
id=
"get"
resultType=
"Area"
>
SELECT
<include
refid=
"areaColumns"
/>
FROM sys_area a
FROM
ct_bbtc_
sys_area a
<include
refid=
"areaJoins"
/>
WHERE a.id = #{id}
</select>
...
...
@@ -34,7 +34,7 @@
<select
id=
"findList"
resultType=
"Area"
>
SELECT
<include
refid=
"areaColumns"
/>
FROM sys_area a
FROM
ct_bbtc_
sys_area a
<include
refid=
"areaJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<!-- 数据范围过滤 -->
...
...
@@ -46,7 +46,7 @@
<select
id=
"findAllList"
resultType=
"Area"
>
SELECT
<include
refid=
"areaColumns"
/>
FROM sys_area a
FROM
ct_bbtc_
sys_area a
<include
refid=
"areaJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code
...
...
@@ -57,13 +57,13 @@
a.id,
a.parent_id AS "parent.id",
a.parent_ids
FROM sys_area a
FROM
ct_bbtc_
sys_area a
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code
</select>
<insert
id=
"insert"
>
INSERT INTO sys_area(
INSERT INTO
ct_bbtc_
sys_area(
id,
parent_id,
parent_ids,
...
...
@@ -95,7 +95,7 @@
</insert>
<update
id=
"update"
>
UPDATE sys_area SET
UPDATE
ct_bbtc_
sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
code = #{code},
...
...
@@ -109,14 +109,14 @@
</update>
<update
id=
"updateParentIds"
>
UPDATE sys_area SET
UPDATE
ct_bbtc_
sys_area SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update
id=
"delete"
>
UPDATE sys_area SET
UPDATE
ct_bbtc_
sys_area SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
...
...
src/main/resources/mappings/modules/sys/DictDao.xml
View file @
2025ad5b
...
...
@@ -5,14 +5,14 @@
<select
id=
"get"
resultType=
"Dict"
>
SELECT
*
FROM sys_dict
FROM
ct_bbtc_
sys_dict
WHERE id = #{id}
</select>
<select
id=
"findList"
resultType=
"Dict"
>
SELECT
*
FROM sys_dict
FROM
ct_bbtc_
sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"type != null and type != ''"
>
AND type = #{type}
...
...
@@ -29,7 +29,7 @@
<select
id=
"findAllList"
resultType=
"Dict"
>
SELECT
*
FROM sys_dict
FROM
ct_bbtc_
sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL}
ORDER BY type, sort, update_date DESC
</select>
...
...
@@ -37,14 +37,14 @@
<select
id=
"findTypeList"
resultType=
"string"
>
SELECT
type
FROM sys_dict
FROM
ct_bbtc_
sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL}
GROUP BY type
ORDER BY type
</select>
<insert
id=
"insert"
>
INSERT INTO sys_dict(
INSERT INTO
ct_bbtc_
sys_dict(
id,
value,
label,
...
...
@@ -74,7 +74,7 @@
</insert>
<update
id=
"update"
>
UPDATE sys_dict SET
UPDATE
ct_bbtc_
sys_dict SET
value = #{value},
label = #{label},
type = #{type},
...
...
@@ -87,7 +87,7 @@
</update>
<update
id=
"delete"
>
UPDATE sys_dict SET
UPDATE
ct_bbtc_
sys_dict SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
...
...
src/main/resources/mappings/modules/sys/LogDao.xml
View file @
2025ad5b
...
...
@@ -9,10 +9,10 @@
u.name AS "createBy.name",
c.name AS "createBy.company.name",
o.name AS "createBy.office.name"
FROM sys_log a
LEFT JOIN sys_user u ON u.id = a.create_by
LEFT JOIN sys_office c ON c.id = u.company_id
LEFT JOIN sys_office o ON o.id = u.office_id
FROM
ct_bbtc_
sys_log a
LEFT JOIN
ct_bbtc_
sys_user u ON u.id = a.create_by
LEFT JOIN
ct_bbtc_
sys_office c ON c.id = u.company_id
LEFT JOIN
ct_bbtc_
sys_office o ON o.id = u.office_id
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
<if
test=
"title != null and title != ''"
>
AND a.title LIKE
...
...
@@ -36,7 +36,7 @@
</select>
<insert
id=
"insert"
>
INSERT INTO sys_log(
INSERT INTO
ct_bbtc_
sys_log(
id,
type,
title,
...
...
src/main/resources/mappings/modules/sys/MenuDao.xml
View file @
2025ad5b
...
...
@@ -23,14 +23,14 @@
</sql>
<sql
id=
"menuJoins"
>
LEFT JOIN sys_menu p
LEFT JOIN
ct_bbtc_
sys_menu p
ON p.id = a.parent_id
</sql>
<select
id=
"get"
resultType=
"Menu"
>
SELECT
<include
refid=
"menuColumns"
/>
FROM sys_menu a
FROM
ct_bbtc_
sys_menu a
<include
refid=
"menuJoins"
/>
WHERE a.id = #{id}
</select>
...
...
@@ -38,7 +38,7 @@
<select
id=
"findAllList"
resultType=
"Menu"
>
SELECT
<include
refid=
"menuColumns"
/>
FROM sys_menu a
FROM
ct_bbtc_
sys_menu a
<include
refid=
"menuJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.sort
...
...
@@ -49,7 +49,7 @@
a.id,
a.parent_id AS "parent.id",
a.parent_ids
FROM sys_menu a
FROM
ct_bbtc_
sys_menu a
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.sort
</select>
...
...
@@ -57,18 +57,18 @@
<select
id=
"findByUserId"
resultType=
"Menu"
>
SELECT DISTINCT
<include
refid=
"menuColumns"
/>
FROM sys_menu a
LEFT JOIN sys_menu p ON p.id = a.parent_id
JOIN sys_menu2role rm ON rm.menu_id = a.id
JOIN sys_role r ON r.id = rm.role_id AND r.useable='1'
JOIN sys_user2role ur ON ur.role_id = r.id
JOIN sys_user u ON u.id = ur.user_id AND u.id = #{userId}
FROM
ct_bbtc_
sys_menu a
LEFT JOIN
ct_bbtc_
sys_menu p ON p.id = a.parent_id
JOIN
ct_bbtc_
sys_menu2role rm ON rm.menu_id = a.id
JOIN
ct_bbtc_
sys_role r ON r.id = rm.role_id AND r.useable='1'
JOIN
ct_bbtc_
sys_user2role ur ON ur.role_id = r.id
JOIN
ct_bbtc_
sys_user u ON u.id = ur.user_id AND u.id = #{userId}
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND r.del_flag = #{DEL_FLAG_NORMAL} AND u.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.sort
</select>
<insert
id=
"insert"
>
INSERT INTO sys_menu(
INSERT INTO
ct_bbtc_
sys_menu(
id,
parent_id,
parent_ids,
...
...
@@ -106,7 +106,7 @@
</insert>
<update
id=
"update"
>
UPDATE sys_menu SET
UPDATE
ct_bbtc_
sys_menu SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
name = #{name},
...
...
@@ -123,20 +123,20 @@
</update>
<update
id=
"updateParentIds"
>
UPDATE sys_menu SET
UPDATE
ct_bbtc_
sys_menu SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update
id=
"updateSort"
>
UPDATE sys_menu SET
UPDATE
ct_bbtc_
sys_menu SET
sort = #{sort}
WHERE id = #{id}
</update>
<update
id=
"delete"
>
UPDATE sys_menu SET
UPDATE
ct_bbtc_
sys_menu SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
...
...
src/main/resources/mappings/modules/sys/OfficeDao.xml
View file @
2025ad5b
...
...
@@ -37,16 +37,16 @@
</sql>
<sql
id=
"officeJoins"
>
LEFT JOIN sys_office p ON p.id = a.parent_id
LEFT JOIN sys_area ar ON ar.id = a.area_id
LEFT JOIN sys_user pp ON pp.id = a.primary_person
LEFT JOIN sys_user dp ON dp.id = a.deputy_person
LEFT JOIN
ct_bbtc_
sys_office p ON p.id = a.parent_id
LEFT JOIN
ct_bbtc_
sys_area ar ON ar.id = a.area_id
LEFT JOIN
ct_bbtc_
sys_user pp ON pp.id = a.primary_person
LEFT JOIN
ct_bbtc_
sys_user dp ON dp.id = a.deputy_person
</sql>
<select
id=
"get"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.id = #{id}
</select>
...
...
@@ -54,7 +54,7 @@
<select
id=
"findList"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<!-- 数据范围过滤 -->
...
...
@@ -66,7 +66,7 @@
<select
id=
"findAllList"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code
...
...
@@ -75,7 +75,7 @@
<select
id=
"findByParentIdsLike"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code
...
...
@@ -85,7 +85,7 @@
<select
id=
"findByParentId"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id = #{parent.id}
ORDER BY a.code
...
...
@@ -94,7 +94,7 @@
<select
id=
"findByOfficeName"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = '0' AND a.name = #{officeName}
...
...
@@ -103,13 +103,13 @@
<select
id=
"getCompany"
resultType=
"Office"
>
SELECT
<include
refid=
"officeColumns"
/>
FROM sys_office a
FROM
ct_bbtc_
sys_office a
<include
refid=
"officeJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id='1'
limit 1
</select>
<insert
id=
"insert"
>
INSERT INTO sys_office(
INSERT INTO
ct_bbtc_
sys_office(
id,
parent_id,
parent_ids,
...
...
@@ -163,7 +163,7 @@
</insert>
<update
id=
"update"
>
UPDATE sys_office SET
UPDATE
ct_bbtc_
sys_office SET
parent_id = #{parent.id},
parent_ids = #{parentIds},
area_id = #{area.id},
...
...
@@ -187,14 +187,14 @@
</update>
<update
id=
"updateParentIds"
>
UPDATE sys_office SET
UPDATE
ct_bbtc_
sys_office SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<update
id=
"delete"
>
UPDATE sys_office SET
UPDATE
ct_bbtc_
sys_office SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
...
...
src/main/resources/mappings/modules/sys/RoleDao.xml
View file @
2025ad5b
...
...
@@ -62,16 +62,16 @@
uo.name AS "userList.office.name", -->
rm.menu_id AS "menuList.id",
ro.office_id AS "officeList.id"
FROM sys_role a
LEFT JOIN sys_office o
FROM
ct_bbtc_
sys_role a
LEFT JOIN
ct_bbtc_
sys_office o
ON o.id = a.office_id
<!--
LEFT JOIN sys_user2role ur ON ur.role_id = a.id
LEFT JOIN sys_user u ON u.id = ur.user_id
LEFT JOIN sys_office uc ON uc.id = u.company_id
LEFT JOIN sys_office uo ON uo.id = u.office_id -->
LEFT JOIN sys_menu2role rm
LEFT JOIN
ct_bbtc_
sys_user2role ur ON ur.role_id = a.id
LEFT JOIN
ct_bbtc_
sys_user u ON u.id = ur.user_id
LEFT JOIN
ct_bbtc_
sys_office uc ON uc.id = u.company_id
LEFT JOIN
ct_bbtc_
sys_office uo ON uo.id = u.office_id -->
LEFT JOIN
ct_bbtc_
sys_menu2role rm
ON rm.role_id = a.id
LEFT JOIN sys_office2role ro
LEFT JOIN
ct_bbtc_
sys_office2role ro
ON ro.role_id = a.id
WHERE a.id = #{id}
</select>
...
...
@@ -79,16 +79,16 @@
<select
id=
"getByName"
resultType=
"Role"
>
SELECT
<include
refid=
"roleColumns"
/>
FROM sys_role a
JOIN sys_office o ON o.id = a.office_id
FROM
ct_bbtc_
sys_role a
JOIN
ct_bbtc_
sys_office o ON o.id = a.office_id
WHERE a.name = #{name} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select>
<select
id=
"getByEnname"
resultType=
"Role"
>
SELECT
<include
refid=
"roleColumns"
/>
FROM sys_role a
JOIN sys_office o ON o.id = a.office_id
FROM
ct_bbtc_
sys_role a
JOIN
ct_bbtc_
sys_office o ON o.id = a.office_id
WHERE a.enname = #{enname} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select>
...
...
@@ -96,11 +96,11 @@
SELECT
<!-- DISTINCT -->
<include
refid=
"roleColumns"
/>
,
ro.office_id AS "officeList.id"
FROM sys_role a
LEFT JOIN sys_office o ON o.id = a.office_id
LEFT JOIN sys_user2role ur ON ur.role_id = a.id
LEFT JOIN sys_user u ON u.id = ur.user_id
LEFT JOIN sys_office2role ro ON ro.role_id = a.id
FROM
ct_bbtc_
sys_role a
LEFT JOIN
ct_bbtc_
sys_office o ON o.id = a.office_id
LEFT JOIN
ct_bbtc_
sys_user2role ur ON ur.role_id = a.id
LEFT JOIN
ct_bbtc_
sys_user u ON u.id = ur.user_id
LEFT JOIN
ct_bbtc_
sys_office2role ro ON ro.role_id = a.id
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.useable=#{useable}
<if
test=
"user != null and user.id != null and user.id != ''"
>
AND u.id = #{user.id}
...
...
@@ -116,8 +116,8 @@
<select
id=
"findAllList"
resultType=
"Role"
>
SELECT
<include
refid=
"roleColumns"
/>
FROM sys_role a
LEFT JOIN sys_office o ON o.id = a.office_id
FROM
ct_bbtc_
sys_role a
LEFT JOIN
ct_bbtc_
sys_office o ON o.id = a.office_id
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"unChecked != null and unChecked != ''"
>
AND a.un_checked = #{unChecked}
...
...
@@ -126,7 +126,7 @@
</select>
<insert
id=
"insert"
>
INSERT INTO sys_role(
INSERT INTO
ct_bbtc_
sys_role(
id,
office_id,
name,
...
...
@@ -160,7 +160,7 @@
</insert>
<update
id=
"update"
>
UPDATE sys_role SET
UPDATE
ct_bbtc_
sys_role SET
office_id = #{office.id},
name = #{name},
enname = #{enname},
...
...
@@ -175,11 +175,11 @@
</update>
<delete
id=
"deleteRoleMenu"
>
DELETE FROM sys_menu2role WHERE role_id = #{id}
DELETE FROM
ct_bbtc_
sys_menu2role WHERE role_id = #{id}
</delete>
<insert
id=
"insertRoleMenu"
>
INSERT INTO sys_menu2role(role_id, menu_id)
INSERT INTO
ct_bbtc_
sys_menu2role(role_id, menu_id)
<foreach
collection=
"menuList"
item=
"menu"
separator=
" union all "
>
SELECT #{id}, #{menu.id}
<if
test=
"dbName != 'mssql'"
>
...
...
@@ -189,11 +189,11 @@
</insert>
<delete
id=
"deleteRoleOffice"
>
DELETE FROM sys_office2role WHERE role_id = #{id}
DELETE FROM
ct_bbtc_
sys_office2role WHERE role_id = #{id}
</delete>
<insert
id=
"insertRoleOffice"
>
INSERT INTO sys_office2role(role_id, office_id)
INSERT INTO
ct_bbtc_
sys_office2role(role_id, office_id)
<foreach
collection=
"officeList"
item=
"office"
separator=
" union all "
>
SELECT #{id}, #{office.id}
<if
test=
"dbName != 'mssql'"
>
...
...
@@ -203,7 +203,7 @@
</insert>
<update
id=
"delete"
>
UPDATE sys_role SET
UPDATE
ct_bbtc_
sys_role SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
...
...
src/main/resources/mappings/modules/sys/UserDao.xml
View file @
2025ad5b
...
...
@@ -111,23 +111,23 @@
</sql>
<sql
id=
"userJoins"
>
LEFT JOIN sys_office c ON c.id = a.company_id
LEFT JOIN sys_area ca ON ca.id = c.area_id
LEFT JOIN sys_office o ON o.id = a.office_id
LEFT JOIN sys_area oa ON oa.id = o.area_id
LEFT JOIN sys_user cu ON cu.id = c.primary_person
LEFT JOIN sys_user cu2 ON cu2.id = c.deputy_person
LEFT JOIN sys_user ou ON ou.id = o.primary_person
LEFT JOIN sys_user ou2 ON ou2.id = o.deputy_person
<!--
LEFT JOIN sys_user2role ur ON ur.user_id = a.id
LEFT JOIN sys_role r ON r.id = ur.role_id -->
LEFT JOIN
ct_bbtc_
sys_office c ON c.id = a.company_id
LEFT JOIN
ct_bbtc_
sys_area ca ON ca.id = c.area_id
LEFT JOIN
ct_bbtc_
sys_office o ON o.id = a.office_id
LEFT JOIN
ct_bbtc_
sys_area oa ON oa.id = o.area_id
LEFT JOIN
ct_bbtc_
sys_user cu ON cu.id = c.primary_person
LEFT JOIN
ct_bbtc_
sys_user cu2 ON cu2.id = c.deputy_person
LEFT JOIN
ct_bbtc_
sys_user ou ON ou.id = o.primary_person
LEFT JOIN
ct_bbtc_
sys_user ou2 ON ou2.id = o.deputy_person
<!--
LEFT JOIN
ct_bbtc_
sys_user2role ur ON ur.user_id = a.id
LEFT JOIN
ct_bbtc_
sys_role r ON r.id = ur.role_id -->
</sql>
<!-- 根据编号获得用户 -->
<select
id=
"get"
resultType=
"User"
>
SELECT
<include
refid=
"userColumns"
/>
FROM sys_user a
FROM
ct_bbtc_
sys_user a
<include
refid=
"userJoins"
/>
WHERE a.id = #{id}
</select>
...
...
@@ -137,9 +137,9 @@
SELECT
<include
refid=
"userColumns"
/>
<!-- ,
ro.office_id AS "roleList.officeList.id" -->
FROM sys_user a
FROM
ct_bbtc_
sys_user a
<include
refid=
"userJoins"
/>
<!--
LEFT JOIN sys_office2role ro ON ro.role_id = r.id -->
LEFT JOIN
ct_bbtc_
sys_office2role ro ON ro.role_id = r.id -->
WHERE a.login_name = #{loginName} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select>
...
...
@@ -148,13 +148,13 @@
SELECT
role.id AS roleId,
<include
refid=
"userColumns"
/>
FROM sys_user a
FROM
ct_bbtc_
sys_user a
<include
refid=
"userJoins"
/>
<if
test=
"role != null and role.id != null and role.id != ''"
>
JOIN sys_user2role ur ON ur.user_id = a.id AND ur.role_id = #{role.id}
JOIN
ct_bbtc_
sys_user2role ur ON ur.user_id = a.id AND ur.role_id = #{role.id}
</if>
LEFT JOIN sys_user2role ur ON ur.user_id = a.id
LEFT JOIN sys_role role ON ur.role_id = role.id
LEFT JOIN
ct_bbtc_
sys_user2role ur ON ur.user_id = a.id
LEFT JOIN
ct_bbtc_
sys_role role ON ur.role_id = role.id
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<if
test=
"company != null and company.id != null and company.id != ''"
>
AND (c.id = #{company.id} OR c.parent_ids LIKE
...
...
@@ -200,7 +200,7 @@
<select
id=
"findUserByOfficeId"
resultType=
"User"
useCache=
"true"
>
SELECT
a.id, a.name, a.login_name
FROM sys_user a
FROM
ct_bbtc_
sys_user a
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
AND a.office_id = #{office.id}
ORDER BY a.name
...
...
@@ -210,7 +210,7 @@
<select
id=
"findAllList"
resultType=
"User"
>
SELECT
<include
refid=
"userColumns"
/>
FROM sys_user a
FROM
ct_bbtc_
sys_user a
<include
refid=
"userJoins"
/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY c.code, o.code, a.name
...
...
@@ -220,13 +220,13 @@
<select
id=
"findAllCount"
resultType=
"long"
>
SELECT
COUNT(1)
FROM sys_user a
FROM
ct_bbtc_
sys_user a
WHERE a.del_flag = #{DEL_FLAG_NORMAL}
</select>
<!-- 插入用户 -->
<insert
id=
"insert"
>
INSERT INTO sys_user(
INSERT INTO
ct_bbtc_
sys_user(
id,
company_id,
office_id,
...
...
@@ -269,7 +269,7 @@
)
</insert>
<insert
id=
"insertOfficeName"
>
INSERT INTO sys_user_profiles(
INSERT INTO
ct_bbtc_
sys_user_profiles(
user_id,
office_name,
device_update
...
...
@@ -281,7 +281,7 @@
</insert>
<!-- 更新用户 -->
<update
id=
"update"
>
UPDATE sys_user SET
UPDATE
ct_bbtc_
sys_user SET
company_id = #{company.id},
office_id = #{office.id},
login_name = #{loginName},
...
...
@@ -302,12 +302,12 @@
<!-- 删除用户和角色关联表数据 -->
<delete
id=
"deleteUserRole"
>
DELETE FROM sys_user2role WHERE user_id = #{id}
DELETE FROM
ct_bbtc_
sys_user2role WHERE user_id = #{id}
</delete>
<!-- 插入用户和角色关联表数据 -->
<insert
id=
"insertUserRole"
>
INSERT INTO sys_user2role(user_id, role_id)
INSERT INTO
ct_bbtc_
sys_user2role(user_id, role_id)
<foreach
collection=
"roleList"
item=
"role"
separator=
" union all "
>
SELECT #{id}, #{role.id}
<if
test=
"dbName != 'mssql'"
>
...
...
@@ -318,7 +318,7 @@
<!-- 更新用户信息 -->
<update
id=
"updateUserInfo"
>
UPDATE sys_user SET
UPDATE
ct_bbtc_
sys_user SET
email = #{email},
phone = #{phone},
mobile = #{mobile},
...
...
@@ -331,14 +331,14 @@
<!-- 更新用户密码 -->
<update
id=
"updatePasswordById"
>
UPDATE sys_user SET
UPDATE
ct_bbtc_
sys_user SET
password = #{password}
WHERE id = #{id}
</update>
<!-- 更新登录信息,如登录IP、登录时间 -->
<update
id=
"updateLoginInfo"
>
UPDATE sys_user SET
UPDATE
ct_bbtc_
sys_user SET
login_ip = #{loginIp},
login_Date = #{loginDate}
WHERE id = #{id}
...
...
@@ -346,7 +346,7 @@
<!-- 逻辑删除用户 -->
<update
id=
"delete"
>
UPDATE sys_user SET
UPDATE
ct_bbtc_
sys_user SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
...
...
src/main/resources/mappings/modules/upload/UploadDao.xml
View file @
2025ad5b
...
...
@@ -20,7 +20,7 @@
orientation
</sql>
<insert
id=
"addUploadFile"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO upload_files(
INSERT INTO
ct_bbtc_
upload_files(
<include
refid=
"fileColumns"
/>
) VALUES(
#{fileId},
...
...
@@ -43,7 +43,7 @@
</insert>
<select
id=
"getFileByPath"
resultType=
"com.ejweb.modules.upload.entity.UploadEntity"
>
SELECT orientation FROM upload_files
SELECT orientation FROM
ct_bbtc_
upload_files
WHERE #{path} LIKE CONCAT('%', path, '%')
</select>
</mapper>
\ No newline at end of file
src/main/resources/mappings/modules/workbench/ReportNoticeMapper.xml
View file @
2025ad5b
...
...
@@ -21,15 +21,15 @@
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from report_notice
from
ct_bbtc_
report_notice
where id = #{id,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from report_notice
delete from
ct_bbtc_
report_notice
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.ejweb.modules.workbench.entity.ReportNotice"
>
insert into
report_notice (id, title, send_time,
insert into
ct_bbtc_report_notice (id, title, send_time,
send_from_id, send_to_id, status,
create_by, create_date, update_by,
update_date)
...
...
@@ -39,7 +39,7 @@
#{updateDate,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.ejweb.modules.workbench.entity.ReportNotice"
>
insert into report_notice
insert into
ct_bbtc_
report_notice
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
...
...
@@ -106,7 +106,7 @@
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.ejweb.modules.workbench.entity.ReportNotice"
>
update report_notice
update
ct_bbtc_
report_notice
<set
>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
...
...
@@ -139,7 +139,7 @@
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.ejweb.modules.workbench.entity.ReportNotice"
>
update report_notice
update
ct_bbtc_
report_notice
set title = #{title,jdbcType=VARCHAR},
send_time = #{sendTime,jdbcType=VARCHAR},
send_from_id = #{sendFromId,jdbcType=VARCHAR},
...
...
@@ -154,7 +154,7 @@
<select
id=
"selectBySendToId"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM report_notice
FROM
ct_bbtc_
report_notice
WHERE send_to_id = #{sendToId,jdbcType=VARCHAR}
order by create_date desc
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment