Commit 129be39e by Java-李昕颖

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	src/main/resources/mappings/modules/report/ReportDao.xml
parents b5765e74 2025ad5b
...@@ -72,7 +72,7 @@ public abstract class BaseService { ...@@ -72,7 +72,7 @@ public abstract class BaseService {
// if (StringUtils.isNotEmpty(officeIds)){ // if (StringUtils.isNotEmpty(officeIds)){
// sqlString.append(" OR " + oa + ".id IN ('" + 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)"); sqlString.append(" AND office_id = " + oa +".id)");
} }
//else if (Role.DATA_SCOPE_SELF.equals(r.getDataScope())){ //else if (Role.DATA_SCOPE_SELF.equals(r.getDataScope())){
...@@ -169,7 +169,7 @@ public abstract class BaseService { ...@@ -169,7 +169,7 @@ public abstract class BaseService {
sqlString.append(" AND " + where +")"); sqlString.append(" AND " + where +")");
} }
else if (Role.DATA_SCOPE_CUSTOM.equals(dataScopeString)){ 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(" WHERE ro123456.office_id = o123456.id");
sqlString.append(" AND ro123456.role_id = '" + roleId + "'"); sqlString.append(" AND ro123456.role_id = '" + roleId + "'");
sqlString.append(" AND o123456." + where +")"); sqlString.append(" AND o123456." + where +")");
...@@ -178,7 +178,7 @@ public abstract class BaseService { ...@@ -178,7 +178,7 @@ public abstract class BaseService {
// 生成个人权限SQL语句 // 生成个人权限SQL语句
for (String where : StringUtils.split(userWheres, ",")){ for (String where : StringUtils.split(userWheres, ",")){
if (Role.DATA_SCOPE_SELF.equals(dataScopeString)){ 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(" WHERE id='" + user.getId() + "'");
sqlString.append(" AND " + where + ")"); sqlString.append(" AND " + where + ")");
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
SELECT SELECT
count(*) count(*)
FROM FROM
sys_user su ct_bbtc_sys_user su
WHERE WHERE
su.login_name = #{username} su.login_name = #{username}
</select> </select>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
height height
</sql> </sql>
<insert id="addUploadFile" useGeneratedKeys="true" keyProperty="id"> <insert id="addUploadFile" useGeneratedKeys="true" keyProperty="id">
INSERT INTO upload_files( INSERT INTO ct_bbtc_upload_files(
<include refid="fileColumns"/> <include refid="fileColumns"/>
) VALUES( ) VALUES(
#{id}, #{id},
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<select id="getUploadEntityByPath" resultType="com.ejweb.modules.upload.entity.UploadEntity"> <select id="getUploadEntityByPath" resultType="com.ejweb.modules.upload.entity.UploadEntity">
SELECT SELECT
<include refid="fileColumns"/> <include refid="fileColumns"/>
FROM upload_files FROM ct_bbtc_upload_files
WHERE path = #{code} WHERE path = #{code}
ORDER BY created DESC ORDER BY created DESC
limit 1 limit 1
......
...@@ -87,9 +87,9 @@ ...@@ -87,9 +87,9 @@
<select id="getUser" resultType="com.ejweb.modules.sys.entity.User"> <select id="getUser" resultType="com.ejweb.modules.sys.entity.User">
SELECT u.id SELECT u.id
FROM sys_user u FROM ct_bbtc_sys_user u
LEFT JOIN sys_user2role u2r ON u2r.user_id = u.id LEFT JOIN ct_bbtc_sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN sys_role r ON r.id = u2r.role_id LEFT JOIN ct_bbtc_sys_role r ON r.id = u2r.role_id
WHERE r.enname = 'admin' WHERE r.enname = 'admin'
limit 1 limit 1
</select> </select>
......
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
<select id="findRole" parameterType="User" resultType="String"> <select id="findRole" parameterType="User" resultType="String">
SELECT SELECT
sr.name AS "roleName" sr.name AS "roleName"
FROM sys_role sr FROM ct_bbtc_sys_role sr
LEFT JOIN sys_user2role sur ON sr.id = sur.role_id LEFT JOIN ct_bbtc_sys_user2role sur ON sr.id = sur.role_id
LEFT JOIN sys_user su ON su.id = sur.user_id LEFT JOIN ct_bbtc_sys_user su ON su.id = sur.user_id
WHERE su.id = #{id} WHERE su.id = #{id}
</select> </select>
...@@ -225,15 +225,13 @@ ...@@ -225,15 +225,13 @@
sr.`name` AS "role.name", sr.`name` AS "role.name",
CONCAT(IFNULL(sac.`name`,""),"-",IFNULL(sao.`name`,"")) AS "devision" CONCAT(IFNULL(sac.`name`,""),"-",IFNULL(sao.`name`,"")) AS "devision"
FROM FROM
sys_user su ct_bbtc_sys_user su
LEFT JOIN sys_office so1 ON so1.id = su.company_id LEFT JOIN ct_bbtc_sys_office so1 ON so1.id = su.company_id
LEFT JOIN sys_office so2 ON so2.id = su.office_id LEFT JOIN ct_bbtc_sys_office so2 ON so2.id = su.office_id
LEFT JOIN sys_user2position sup ON sup.user_id = su.id LEFT JOIN ct_bbtc_sys_user2position sup ON sup.user_id = su.id
LEFT JOIN sys_position sp ON sp.id = sup.position_id LEFT JOIN ct_bbtc_sys_position sp ON sp.id = sup.position_id
LEFT JOIN sys_user2role sur ON su.id = sur.user_id LEFT JOIN ct_bbtc_sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id LEFT JOIN ct_bbtc_sys_role sr ON sr.id = sur.role_id
LEFT JOIN sys_area sac ON sac.id = so1.area_id
LEFT JOIN sys_area sao ON sao.id = so2.area_id
<where> <where>
1 = 1 1 = 1
<if test="no != null and no != ''"> <if test="no != null and no != ''">
...@@ -276,8 +274,8 @@ ...@@ -276,8 +274,8 @@
<select id="getOfficeList" resultType="Office"> <select id="getOfficeList" resultType="Office">
SELECT SELECT
so.id AS "id", so.id AS "id",
CONCAT(so.`name`,'(',(SELECT s.`name` FROM sys_office s WHERE s.id = so.parent_id),')') AS "name" CONCAT(so.`name`,'(',(SELECT s.`name` FROM ct_bbtc_sys_office s WHERE s.id = so.parent_id),')') AS "name"
FROM sys_office so FROM ct_bbtc_sys_office so
WHERE so.type = '2' WHERE so.type = '2'
</select> </select>
...@@ -285,7 +283,7 @@ ...@@ -285,7 +283,7 @@
SELECT SELECT
so.id AS "id", so.id AS "id",
so.`name` AS "name" so.`name` AS "name"
FROM sys_office so FROM ct_bbtc_sys_office so
WHERE so.type = '1' WHERE so.type = '1'
</select> </select>
...@@ -293,7 +291,7 @@ ...@@ -293,7 +291,7 @@
SELECT SELECT
position_code AS "id", position_code AS "id",
position_name AS "positionName" position_name AS "positionName"
FROM sys_position FROM ct_bbtc_sys_position
</select> </select>
<insert id="addReportNotice"> <insert id="addReportNotice">
...@@ -351,15 +349,15 @@ ...@@ -351,15 +349,15 @@
SELECT SELECT
su.id su.id
FROM FROM
sys_user su ct_bbtc_sys_user su
LEFT JOIN sys_user2role sur ON su.id = sur.user_id LEFT JOIN ct_bbtc_sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id LEFT JOIN ct_bbtc_sys_role sr ON sr.id = sur.role_id
WHERE WHERE
sr.`name` = '系统管理员' sr.`name` = '系统管理员'
</select> </select>
<insert id="addRecord"> <insert id="addRecord">
INSERT INTO report_exchange_history( INSERT INTO ct_bbtc_report_exchange_his(
id, id,
report_id, report_id,
old_user_id, old_user_id,
...@@ -493,7 +491,7 @@ ...@@ -493,7 +491,7 @@
r.supplement_type AS "supplementType", r.supplement_type AS "supplementType",
r.deal_person_name AS "dealPersonName", r.deal_person_name AS "dealPersonName",
r.deal_result AS "dealResult", 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" r.exchange_type AS "exchangeType"
FROM report r FROM report r
<where> <where>
......
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from report_attachment from ct_bbtc_report_attachment
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" > <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from report_attachment delete from ct_bbtc_report_attachment
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<insert id="insert" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" > <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 attachment_path, attachment_size, attachment_type
) )
values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{attachmentName,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{attachmentName,jdbcType=VARCHAR},
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" > <insert id="insertSelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
insert into report_attachment insert into ct_bbtc_report_attachment
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" > <if test="id != null" >
id, id,
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" > <update id="updateByPrimaryKeySelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
update report_attachment update ct_bbtc_report_attachment
<set > <set >
<if test="reportId != null" > <if test="reportId != null" >
report_id = #{reportId,jdbcType=VARCHAR}, report_id = #{reportId,jdbcType=VARCHAR},
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" > <update id="updateByPrimaryKey" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
update report_attachment update ct_bbtc_report_attachment
set report_id = #{reportId,jdbcType=VARCHAR}, set report_id = #{reportId,jdbcType=VARCHAR},
attachment_name = #{attachmentName,jdbcType=VARCHAR}, attachment_name = #{attachmentName,jdbcType=VARCHAR},
attachment_path = #{attachmentPath,jdbcType=VARCHAR}, attachment_path = #{attachmentPath,jdbcType=VARCHAR},
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
</sql> </sql>
<sql id="areaJoins"> <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> </sql>
<select id="get" resultType="Area"> <select id="get" resultType="Area">
SELECT SELECT
<include refid="areaColumns"/> <include refid="areaColumns"/>
FROM sys_area a FROM ct_bbtc_sys_area a
<include refid="areaJoins"/> <include refid="areaJoins"/>
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<select id="findList" resultType="Area"> <select id="findList" resultType="Area">
SELECT SELECT
<include refid="areaColumns"/> <include refid="areaColumns"/>
FROM sys_area a FROM ct_bbtc_sys_area a
<include refid="areaJoins"/> <include refid="areaJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<select id="findAllList" resultType="Area"> <select id="findAllList" resultType="Area">
SELECT SELECT
<include refid="areaColumns"/> <include refid="areaColumns"/>
FROM sys_area a FROM ct_bbtc_sys_area a
<include refid="areaJoins"/> <include refid="areaJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code ORDER BY a.code
...@@ -57,13 +57,13 @@ ...@@ -57,13 +57,13 @@
a.id, a.id,
a.parent_id AS "parent.id", a.parent_id AS "parent.id",
a.parent_ids 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} WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code ORDER BY a.code
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_area( INSERT INTO ct_bbtc_sys_area(
id, id,
parent_id, parent_id,
parent_ids, parent_ids,
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</insert> </insert>
<update id="update"> <update id="update">
UPDATE sys_area SET UPDATE ct_bbtc_sys_area SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds}, parent_ids = #{parentIds},
code = #{code}, code = #{code},
...@@ -109,14 +109,14 @@ ...@@ -109,14 +109,14 @@
</update> </update>
<update id="updateParentIds"> <update id="updateParentIds">
UPDATE sys_area SET UPDATE ct_bbtc_sys_area SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds} parent_ids = #{parentIds}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="delete"> <update id="delete">
UPDATE sys_area SET UPDATE ct_bbtc_sys_area SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if> <if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
<select id="get" resultType="Dict"> <select id="get" resultType="Dict">
SELECT SELECT
* *
FROM sys_dict FROM ct_bbtc_sys_dict
WHERE id = #{id} WHERE id = #{id}
</select> </select>
<select id="findList" resultType="Dict"> <select id="findList" resultType="Dict">
SELECT SELECT
* *
FROM sys_dict FROM ct_bbtc_sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL} WHERE del_flag = #{DEL_FLAG_NORMAL}
<if test="type != null and type != ''"> <if test="type != null and type != ''">
AND type = #{type} AND type = #{type}
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<select id="findAllList" resultType="Dict"> <select id="findAllList" resultType="Dict">
SELECT SELECT
* *
FROM sys_dict FROM ct_bbtc_sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL} WHERE del_flag = #{DEL_FLAG_NORMAL}
ORDER BY type, sort, update_date DESC ORDER BY type, sort, update_date DESC
</select> </select>
...@@ -37,14 +37,14 @@ ...@@ -37,14 +37,14 @@
<select id="findTypeList" resultType="string"> <select id="findTypeList" resultType="string">
SELECT SELECT
type type
FROM sys_dict FROM ct_bbtc_sys_dict
WHERE del_flag = #{DEL_FLAG_NORMAL} WHERE del_flag = #{DEL_FLAG_NORMAL}
GROUP BY type GROUP BY type
ORDER BY type ORDER BY type
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_dict( INSERT INTO ct_bbtc_sys_dict(
id, id,
value, value,
label, label,
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</insert> </insert>
<update id="update"> <update id="update">
UPDATE sys_dict SET UPDATE ct_bbtc_sys_dict SET
value = #{value}, value = #{value},
label = #{label}, label = #{label},
type = #{type}, type = #{type},
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</update> </update>
<update id="delete"> <update id="delete">
UPDATE sys_dict SET UPDATE ct_bbtc_sys_dict SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
u.name AS "createBy.name", u.name AS "createBy.name",
c.name AS "createBy.company.name", c.name AS "createBy.company.name",
o.name AS "createBy.office.name" o.name AS "createBy.office.name"
FROM sys_log a FROM ct_bbtc_sys_log a
LEFT JOIN sys_user u ON u.id = a.create_by LEFT JOIN ct_bbtc_sys_user u ON u.id = a.create_by
LEFT JOIN sys_office c ON c.id = u.company_id LEFT JOIN ct_bbtc_sys_office c ON c.id = u.company_id
LEFT JOIN sys_office o ON o.id = u.office_id LEFT JOIN ct_bbtc_sys_office o ON o.id = u.office_id
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate} WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
<if test="title != null and title != ''"> <if test="title != null and title != ''">
AND a.title LIKE AND a.title LIKE
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_log( INSERT INTO ct_bbtc_sys_log(
id, id,
type, type,
title, title,
......
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
</sql> </sql>
<sql id="menuJoins"> <sql id="menuJoins">
LEFT JOIN sys_menu p LEFT JOIN ct_bbtc_sys_menu p
ON p.id = a.parent_id ON p.id = a.parent_id
</sql> </sql>
<select id="get" resultType="Menu"> <select id="get" resultType="Menu">
SELECT SELECT
<include refid="menuColumns"/> <include refid="menuColumns"/>
FROM sys_menu a FROM ct_bbtc_sys_menu a
<include refid="menuJoins"/> <include refid="menuJoins"/>
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<select id="findAllList" resultType="Menu"> <select id="findAllList" resultType="Menu">
SELECT SELECT
<include refid="menuColumns"/> <include refid="menuColumns"/>
FROM sys_menu a FROM ct_bbtc_sys_menu a
<include refid="menuJoins"/> <include refid="menuJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.sort ORDER BY a.sort
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
a.id, a.id,
a.parent_id AS "parent.id", a.parent_id AS "parent.id",
a.parent_ids 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} WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.sort ORDER BY a.sort
</select> </select>
...@@ -57,18 +57,18 @@ ...@@ -57,18 +57,18 @@
<select id="findByUserId" resultType="Menu"> <select id="findByUserId" resultType="Menu">
SELECT DISTINCT SELECT DISTINCT
<include refid="menuColumns"/> <include refid="menuColumns"/>
FROM sys_menu a FROM ct_bbtc_sys_menu a
LEFT JOIN sys_menu p ON p.id = a.parent_id LEFT JOIN ct_bbtc_sys_menu p ON p.id = a.parent_id
JOIN sys_menu2role rm ON rm.menu_id = a.id JOIN ct_bbtc_sys_menu2role rm ON rm.menu_id = a.id
JOIN sys_role r ON r.id = rm.role_id AND r.useable='1' JOIN ct_bbtc_sys_role r ON r.id = rm.role_id AND r.useable='1'
JOIN sys_user2role ur ON ur.role_id = r.id JOIN ct_bbtc_sys_user2role ur ON ur.role_id = r.id
JOIN sys_user u ON u.id = ur.user_id AND u.id = #{userId} 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} 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 ORDER BY a.sort
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_menu( INSERT INTO ct_bbtc_sys_menu(
id, id,
parent_id, parent_id,
parent_ids, parent_ids,
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</insert> </insert>
<update id="update"> <update id="update">
UPDATE sys_menu SET UPDATE ct_bbtc_sys_menu SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds}, parent_ids = #{parentIds},
name = #{name}, name = #{name},
...@@ -123,20 +123,20 @@ ...@@ -123,20 +123,20 @@
</update> </update>
<update id="updateParentIds"> <update id="updateParentIds">
UPDATE sys_menu SET UPDATE ct_bbtc_sys_menu SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds} parent_ids = #{parentIds}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateSort"> <update id="updateSort">
UPDATE sys_menu SET UPDATE ct_bbtc_sys_menu SET
sort = #{sort} sort = #{sort}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="delete"> <update id="delete">
UPDATE sys_menu SET UPDATE ct_bbtc_sys_menu SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if> <if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
......
...@@ -37,16 +37,16 @@ ...@@ -37,16 +37,16 @@
</sql> </sql>
<sql id="officeJoins"> <sql id="officeJoins">
LEFT JOIN sys_office p ON p.id = a.parent_id LEFT JOIN ct_bbtc_sys_office p ON p.id = a.parent_id
LEFT JOIN sys_area ar ON ar.id = a.area_id LEFT JOIN ct_bbtc_sys_area ar ON ar.id = a.area_id
LEFT JOIN sys_user pp ON pp.id = a.primary_person LEFT JOIN ct_bbtc_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_user dp ON dp.id = a.deputy_person
</sql> </sql>
<select id="get" resultType="Office"> <select id="get" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<select id="findList" resultType="Office"> <select id="findList" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<select id="findAllList" resultType="Office"> <select id="findAllList" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY a.code ORDER BY a.code
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<select id="findByParentIdsLike" resultType="Office"> <select id="findByParentIdsLike" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds} WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_ids LIKE #{parentIds}
ORDER BY a.code ORDER BY a.code
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<select id="findByParentId" resultType="Office"> <select id="findByParentId" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id = #{parent.id} WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id = #{parent.id}
ORDER BY a.code ORDER BY a.code
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<select id="findByOfficeName" resultType="Office"> <select id="findByOfficeName" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = '0' AND a.name = #{officeName} WHERE a.del_flag = '0' AND a.name = #{officeName}
...@@ -103,13 +103,13 @@ ...@@ -103,13 +103,13 @@
<select id="getCompany" resultType="Office"> <select id="getCompany" resultType="Office">
SELECT SELECT
<include refid="officeColumns"/> <include refid="officeColumns"/>
FROM sys_office a FROM ct_bbtc_sys_office a
<include refid="officeJoins"/> <include refid="officeJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id='1' WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.parent_id='1'
limit 1 limit 1
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_office( INSERT INTO ct_bbtc_sys_office(
id, id,
parent_id, parent_id,
parent_ids, parent_ids,
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</insert> </insert>
<update id="update"> <update id="update">
UPDATE sys_office SET UPDATE ct_bbtc_sys_office SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds}, parent_ids = #{parentIds},
area_id = #{area.id}, area_id = #{area.id},
...@@ -187,14 +187,14 @@ ...@@ -187,14 +187,14 @@
</update> </update>
<update id="updateParentIds"> <update id="updateParentIds">
UPDATE sys_office SET UPDATE ct_bbtc_sys_office SET
parent_id = #{parent.id}, parent_id = #{parent.id},
parent_ids = #{parentIds} parent_ids = #{parentIds}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="delete"> <update id="delete">
UPDATE sys_office SET UPDATE ct_bbtc_sys_office SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE WHERE id = #{id} OR parent_ids LIKE
<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if> <if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
......
...@@ -62,16 +62,16 @@ ...@@ -62,16 +62,16 @@
uo.name AS "userList.office.name", --> uo.name AS "userList.office.name", -->
rm.menu_id AS "menuList.id", rm.menu_id AS "menuList.id",
ro.office_id AS "officeList.id" ro.office_id AS "officeList.id"
FROM sys_role a FROM ct_bbtc_sys_role a
LEFT JOIN sys_office o LEFT JOIN ct_bbtc_sys_office o
ON o.id = a.office_id<!-- ON o.id = a.office_id<!--
LEFT JOIN sys_user2role ur ON ur.role_id = a.id LEFT JOIN ct_bbtc_sys_user2role ur ON ur.role_id = a.id
LEFT JOIN sys_user u ON u.id = ur.user_id LEFT JOIN ct_bbtc_sys_user u ON u.id = ur.user_id
LEFT JOIN sys_office uc ON uc.id = u.company_id LEFT JOIN ct_bbtc_sys_office uc ON uc.id = u.company_id
LEFT JOIN sys_office uo ON uo.id = u.office_id --> LEFT JOIN ct_bbtc_sys_office uo ON uo.id = u.office_id -->
LEFT JOIN sys_menu2role rm LEFT JOIN ct_bbtc_sys_menu2role rm
ON rm.role_id = a.id ON rm.role_id = a.id
LEFT JOIN sys_office2role ro LEFT JOIN ct_bbtc_sys_office2role ro
ON ro.role_id = a.id ON ro.role_id = a.id
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
...@@ -79,16 +79,16 @@ ...@@ -79,16 +79,16 @@
<select id="getByName" resultType="Role"> <select id="getByName" resultType="Role">
SELECT SELECT
<include refid="roleColumns"/> <include refid="roleColumns"/>
FROM sys_role a FROM ct_bbtc_sys_role a
JOIN sys_office o ON o.id = a.office_id JOIN ct_bbtc_sys_office o ON o.id = a.office_id
WHERE a.name = #{name} AND a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.name = #{name} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select> </select>
<select id="getByEnname" resultType="Role"> <select id="getByEnname" resultType="Role">
SELECT SELECT
<include refid="roleColumns"/> <include refid="roleColumns"/>
FROM sys_role a FROM ct_bbtc_sys_role a
JOIN sys_office o ON o.id = a.office_id JOIN ct_bbtc_sys_office o ON o.id = a.office_id
WHERE a.enname = #{enname} AND a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.enname = #{enname} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select> </select>
...@@ -96,11 +96,11 @@ ...@@ -96,11 +96,11 @@
SELECT <!-- DISTINCT --> SELECT <!-- DISTINCT -->
<include refid="roleColumns"/>, <include refid="roleColumns"/>,
ro.office_id AS "officeList.id" ro.office_id AS "officeList.id"
FROM sys_role a FROM ct_bbtc_sys_role a
LEFT JOIN sys_office o ON o.id = a.office_id 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 ct_bbtc_sys_user2role ur ON ur.role_id = a.id
LEFT JOIN sys_user u ON u.id = ur.user_id LEFT JOIN ct_bbtc_sys_user u ON u.id = ur.user_id
LEFT JOIN sys_office2role ro ON ro.role_id = a.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} WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND a.useable=#{useable}
<if test="user != null and user.id != null and user.id != ''"> <if test="user != null and user.id != null and user.id != ''">
AND u.id = #{user.id} AND u.id = #{user.id}
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
<select id="findAllList" resultType="Role"> <select id="findAllList" resultType="Role">
SELECT SELECT
<include refid="roleColumns"/> <include refid="roleColumns"/>
FROM sys_role a FROM ct_bbtc_sys_role a
LEFT JOIN sys_office o ON o.id = a.office_id LEFT JOIN ct_bbtc_sys_office o ON o.id = a.office_id
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<if test="unChecked != null and unChecked != ''"> <if test="unChecked != null and unChecked != ''">
AND a.un_checked = #{unChecked} AND a.un_checked = #{unChecked}
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</select> </select>
<insert id="insert"> <insert id="insert">
INSERT INTO sys_role( INSERT INTO ct_bbtc_sys_role(
id, id,
office_id, office_id,
name, name,
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</insert> </insert>
<update id="update"> <update id="update">
UPDATE sys_role SET UPDATE ct_bbtc_sys_role SET
office_id = #{office.id}, office_id = #{office.id},
name = #{name}, name = #{name},
enname = #{enname}, enname = #{enname},
...@@ -175,11 +175,11 @@ ...@@ -175,11 +175,11 @@
</update> </update>
<delete id="deleteRoleMenu"> <delete id="deleteRoleMenu">
DELETE FROM sys_menu2role WHERE role_id = #{id} DELETE FROM ct_bbtc_sys_menu2role WHERE role_id = #{id}
</delete> </delete>
<insert id="insertRoleMenu"> <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 "> <foreach collection="menuList" item="menu" separator=" union all ">
SELECT #{id}, #{menu.id} SELECT #{id}, #{menu.id}
<if test="dbName != 'mssql'"> <if test="dbName != 'mssql'">
...@@ -189,11 +189,11 @@ ...@@ -189,11 +189,11 @@
</insert> </insert>
<delete id="deleteRoleOffice"> <delete id="deleteRoleOffice">
DELETE FROM sys_office2role WHERE role_id = #{id} DELETE FROM ct_bbtc_sys_office2role WHERE role_id = #{id}
</delete> </delete>
<insert id="insertRoleOffice"> <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 "> <foreach collection="officeList" item="office" separator=" union all ">
SELECT #{id}, #{office.id} SELECT #{id}, #{office.id}
<if test="dbName != 'mssql'"> <if test="dbName != 'mssql'">
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
</insert> </insert>
<update id="delete"> <update id="delete">
UPDATE sys_role SET UPDATE ct_bbtc_sys_role SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -111,23 +111,23 @@ ...@@ -111,23 +111,23 @@
</sql> </sql>
<sql id="userJoins"> <sql id="userJoins">
LEFT JOIN sys_office c ON c.id = a.company_id LEFT JOIN ct_bbtc_sys_office c ON c.id = a.company_id
LEFT JOIN sys_area ca ON ca.id = c.area_id LEFT JOIN ct_bbtc_sys_area ca ON ca.id = c.area_id
LEFT JOIN sys_office o ON o.id = a.office_id LEFT JOIN ct_bbtc_sys_office o ON o.id = a.office_id
LEFT JOIN sys_area oa ON oa.id = o.area_id LEFT JOIN ct_bbtc_sys_area oa ON oa.id = o.area_id
LEFT JOIN sys_user cu ON cu.id = c.primary_person LEFT JOIN ct_bbtc_sys_user cu ON cu.id = c.primary_person
LEFT JOIN sys_user cu2 ON cu2.id = c.deputy_person LEFT JOIN ct_bbtc_sys_user cu2 ON cu2.id = c.deputy_person
LEFT JOIN sys_user ou ON ou.id = o.primary_person LEFT JOIN ct_bbtc_sys_user ou ON ou.id = o.primary_person
LEFT JOIN sys_user ou2 ON ou2.id = o.deputy_person<!-- LEFT JOIN ct_bbtc_sys_user ou2 ON ou2.id = o.deputy_person<!--
LEFT JOIN sys_user2role ur ON ur.user_id = a.id LEFT JOIN ct_bbtc_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_role r ON r.id = ur.role_id -->
</sql> </sql>
<!-- 根据编号获得用户 --> <!-- 根据编号获得用户 -->
<select id="get" resultType="User"> <select id="get" resultType="User">
SELECT SELECT
<include refid="userColumns"/> <include refid="userColumns"/>
FROM sys_user a FROM ct_bbtc_sys_user a
<include refid="userJoins"/> <include refid="userJoins"/>
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
...@@ -137,9 +137,9 @@ ...@@ -137,9 +137,9 @@
SELECT SELECT
<include refid="userColumns"/><!-- , <include refid="userColumns"/><!-- ,
ro.office_id AS "roleList.officeList.id" --> ro.office_id AS "roleList.officeList.id" -->
FROM sys_user a FROM ct_bbtc_sys_user a
<include refid="userJoins"/><!-- <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} WHERE a.login_name = #{loginName} AND a.del_flag = #{DEL_FLAG_NORMAL}
</select> </select>
...@@ -148,13 +148,13 @@ ...@@ -148,13 +148,13 @@
SELECT SELECT
role.id AS roleId, role.id AS roleId,
<include refid="userColumns"/> <include refid="userColumns"/>
FROM sys_user a FROM ct_bbtc_sys_user a
<include refid="userJoins"/> <include refid="userJoins"/>
<if test="role != null and role.id != null and role.id != ''"> <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> </if>
LEFT JOIN sys_user2role ur ON ur.user_id = a.id LEFT JOIN ct_bbtc_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_role role ON ur.role_id = role.id
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
<if test="company != null and company.id != null and company.id != ''"> <if test="company != null and company.id != null and company.id != ''">
AND (c.id = #{company.id} OR c.parent_ids LIKE AND (c.id = #{company.id} OR c.parent_ids LIKE
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
<select id="findUserByOfficeId" resultType="User" useCache="true"> <select id="findUserByOfficeId" resultType="User" useCache="true">
SELECT SELECT
a.id, a.name, a.login_name a.id, a.name, a.login_name
FROM sys_user a FROM ct_bbtc_sys_user a
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
AND a.office_id = #{office.id} AND a.office_id = #{office.id}
ORDER BY a.name ORDER BY a.name
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<select id="findAllList" resultType="User"> <select id="findAllList" resultType="User">
SELECT SELECT
<include refid="userColumns"/> <include refid="userColumns"/>
FROM sys_user a FROM ct_bbtc_sys_user a
<include refid="userJoins"/> <include refid="userJoins"/>
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
ORDER BY c.code, o.code, a.name ORDER BY c.code, o.code, a.name
...@@ -220,13 +220,13 @@ ...@@ -220,13 +220,13 @@
<select id="findAllCount" resultType="long"> <select id="findAllCount" resultType="long">
SELECT SELECT
COUNT(1) COUNT(1)
FROM sys_user a FROM ct_bbtc_sys_user a
WHERE a.del_flag = #{DEL_FLAG_NORMAL} WHERE a.del_flag = #{DEL_FLAG_NORMAL}
</select> </select>
<!-- 插入用户 --> <!-- 插入用户 -->
<insert id="insert"> <insert id="insert">
INSERT INTO sys_user( INSERT INTO ct_bbtc_sys_user(
id, id,
company_id, company_id,
office_id, office_id,
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
) )
</insert> </insert>
<insert id="insertOfficeName"> <insert id="insertOfficeName">
INSERT INTO sys_user_profiles( INSERT INTO ct_bbtc_sys_user_profiles(
user_id, user_id,
office_name, office_name,
device_update device_update
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
</insert> </insert>
<!-- 更新用户 --> <!-- 更新用户 -->
<update id="update"> <update id="update">
UPDATE sys_user SET UPDATE ct_bbtc_sys_user SET
company_id = #{company.id}, company_id = #{company.id},
office_id = #{office.id}, office_id = #{office.id},
login_name = #{loginName}, login_name = #{loginName},
...@@ -302,12 +302,12 @@ ...@@ -302,12 +302,12 @@
<!-- 删除用户和角色关联表数据 --> <!-- 删除用户和角色关联表数据 -->
<delete id="deleteUserRole"> <delete id="deleteUserRole">
DELETE FROM sys_user2role WHERE user_id = #{id} DELETE FROM ct_bbtc_sys_user2role WHERE user_id = #{id}
</delete> </delete>
<!-- 插入用户和角色关联表数据 --> <!-- 插入用户和角色关联表数据 -->
<insert id="insertUserRole"> <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 "> <foreach collection="roleList" item="role" separator=" union all ">
SELECT #{id}, #{role.id} SELECT #{id}, #{role.id}
<if test="dbName != 'mssql'"> <if test="dbName != 'mssql'">
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
<!-- 更新用户信息 --> <!-- 更新用户信息 -->
<update id="updateUserInfo"> <update id="updateUserInfo">
UPDATE sys_user SET UPDATE ct_bbtc_sys_user SET
email = #{email}, email = #{email},
phone = #{phone}, phone = #{phone},
mobile = #{mobile}, mobile = #{mobile},
...@@ -331,14 +331,14 @@ ...@@ -331,14 +331,14 @@
<!-- 更新用户密码 --> <!-- 更新用户密码 -->
<update id="updatePasswordById"> <update id="updatePasswordById">
UPDATE sys_user SET UPDATE ct_bbtc_sys_user SET
password = #{password} password = #{password}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<!-- 更新登录信息,如登录IP、登录时间 --> <!-- 更新登录信息,如登录IP、登录时间 -->
<update id="updateLoginInfo"> <update id="updateLoginInfo">
UPDATE sys_user SET UPDATE ct_bbtc_sys_user SET
login_ip = #{loginIp}, login_ip = #{loginIp},
login_Date = #{loginDate} login_Date = #{loginDate}
WHERE id = #{id} WHERE id = #{id}
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
<!-- 逻辑删除用户 --> <!-- 逻辑删除用户 -->
<update id="delete"> <update id="delete">
UPDATE sys_user SET UPDATE ct_bbtc_sys_user SET
del_flag = #{DEL_FLAG_DELETE} del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
orientation orientation
</sql> </sql>
<insert id="addUploadFile" useGeneratedKeys="true" keyProperty="id"> <insert id="addUploadFile" useGeneratedKeys="true" keyProperty="id">
INSERT INTO upload_files( INSERT INTO ct_bbtc_upload_files(
<include refid="fileColumns"/> <include refid="fileColumns"/>
) VALUES( ) VALUES(
#{fileId}, #{fileId},
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</insert> </insert>
<select id="getFileByPath" resultType="com.ejweb.modules.upload.entity.UploadEntity"> <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, '%') WHERE #{path} LIKE CONCAT('%', path, '%')
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -21,15 +21,15 @@ ...@@ -21,15 +21,15 @@
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from report_notice from ct_bbtc_report_notice
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" > <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from report_notice delete from ct_bbtc_report_notice
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</delete> </delete>
<insert id="insert" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" > <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, send_from_id, send_to_id, status,
create_by, create_date, update_by, create_by, create_date, update_by,
update_date) update_date)
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#{updateDate,jdbcType=TIMESTAMP}) #{updateDate,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" > <insert id="insertSelective" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" >
insert into report_notice insert into ct_bbtc_report_notice
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" > <if test="id != null" >
id, id,
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" > <update id="updateByPrimaryKeySelective" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" >
update report_notice update ct_bbtc_report_notice
<set > <set >
<if test="title != null" > <if test="title != null" >
title = #{title,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR},
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" > <update id="updateByPrimaryKey" parameterType="com.ejweb.modules.workbench.entity.ReportNotice" >
update report_notice update ct_bbtc_report_notice
set title = #{title,jdbcType=VARCHAR}, set title = #{title,jdbcType=VARCHAR},
send_time = #{sendTime,jdbcType=VARCHAR}, send_time = #{sendTime,jdbcType=VARCHAR},
send_from_id = #{sendFromId,jdbcType=VARCHAR}, send_from_id = #{sendFromId,jdbcType=VARCHAR},
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<select id="selectBySendToId" resultMap="BaseResultMap"> <select id="selectBySendToId" resultMap="BaseResultMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM report_notice FROM ct_bbtc_report_notice
WHERE send_to_id = #{sendToId,jdbcType=VARCHAR} WHERE send_to_id = #{sendToId,jdbcType=VARCHAR}
order by create_date desc order by create_date desc
</select> </select>
......
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