|
@@ -14,6 +14,8 @@
|
|
|
a.manual_score_user_id AS "manualScoreUserId",
|
|
a.manual_score_user_id AS "manualScoreUserId",
|
|
|
a.manual_score_target_user_id AS "manualScoreTargetUserId",
|
|
a.manual_score_target_user_id AS "manualScoreTargetUserId",
|
|
|
a.manual_score_time AS "manualScoreTime",
|
|
a.manual_score_time AS "manualScoreTime",
|
|
|
|
|
+ a.is_deduction AS "isDeduction",
|
|
|
|
|
+ a.violation_id AS "violationId",
|
|
|
a.create_by AS "createBy.id",
|
|
a.create_by AS "createBy.id",
|
|
|
a.create_date AS "createDate",
|
|
a.create_date AS "createDate",
|
|
|
a.update_by AS "updateBy.id",
|
|
a.update_by AS "updateBy.id",
|
|
@@ -31,7 +33,18 @@
|
|
|
<select id="findList" resultType="com.jeeplus.modules.WorkKnowledgeBase.entity.WorkKnowledgeBasePointDetail">
|
|
<select id="findList" resultType="com.jeeplus.modules.WorkKnowledgeBase.entity.WorkKnowledgeBasePointDetail">
|
|
|
SELECT <include refid="pointDetailColumns"/>
|
|
SELECT <include refid="pointDetailColumns"/>
|
|
|
FROM work_knowledge_base_point_detail a
|
|
FROM work_knowledge_base_point_detail a
|
|
|
- WHERE a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
|
|
|
+ <where>
|
|
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
|
|
+ AND a.user_id = #{userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="shareId != null and shareId != ''">
|
|
|
|
|
+ AND a.share_id = #{shareId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="changeType != null">
|
|
|
|
|
+ AND a.change_type = #{changeType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
ORDER BY a.create_date DESC
|
|
ORDER BY a.create_date DESC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -66,10 +79,12 @@
|
|
|
INSERT INTO work_knowledge_base_point_detail (
|
|
INSERT INTO work_knowledge_base_point_detail (
|
|
|
id, user_id, share_id, change_type, category_id, rule_id, point,
|
|
id, user_id, share_id, change_type, category_id, rule_id, point,
|
|
|
is_manual_score, manual_score_user_id, manual_score_target_user_id, manual_score_time,
|
|
is_manual_score, manual_score_user_id, manual_score_target_user_id, manual_score_time,
|
|
|
|
|
+ is_deduction, violation_id,
|
|
|
create_by, create_date, update_by, update_date, remarks, del_flag
|
|
create_by, create_date, update_by, update_date, remarks, del_flag
|
|
|
) VALUES (
|
|
) VALUES (
|
|
|
#{id}, #{userId}, #{shareId}, #{changeType}, #{categoryId}, #{ruleId}, #{point},
|
|
#{id}, #{userId}, #{shareId}, #{changeType}, #{categoryId}, #{ruleId}, #{point},
|
|
|
#{isManualScore}, #{manualScoreUserId}, #{manualScoreTargetUserId}, #{manualScoreTime},
|
|
#{isManualScore}, #{manualScoreUserId}, #{manualScoreTargetUserId}, #{manualScoreTime},
|
|
|
|
|
+ #{isDeduction}, #{violationId},
|
|
|
#{createBy.id}, #{createDate}, #{updateBy.id}, #{updateDate}, #{remarks}, #{delFlag}
|
|
#{createBy.id}, #{createDate}, #{updateBy.id}, #{updateDate}, #{remarks}, #{delFlag}
|
|
|
)
|
|
)
|
|
|
</insert>
|
|
</insert>
|
|
@@ -116,9 +131,9 @@
|
|
|
LEFT JOIN sys_office o ON o.id = u.office_id
|
|
LEFT JOIN sys_office o ON o.id = u.office_id
|
|
|
<where>
|
|
<where>
|
|
|
u.del_flag = '0'
|
|
u.del_flag = '0'
|
|
|
- <!-- 按积分分类节点及其所有子节点筛选 -->
|
|
|
|
|
|
|
+ <!-- 按积分分类节点及其所有子节点筛选,始终包含扣分标准(id=10)的记录 -->
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR cat.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR cat.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 管理员权限:默认只查看有积分记录的用户 -->
|
|
<!-- 管理员权限:默认只查看有积分记录的用户 -->
|
|
|
<if test="isAdmin != null and isAdmin == 'admin'">
|
|
<if test="isAdmin != null and isAdmin == 'admin'">
|
|
@@ -174,9 +189,9 @@
|
|
|
LEFT JOIN sys_office o ON o.id = u.office_id
|
|
LEFT JOIN sys_office o ON o.id = u.office_id
|
|
|
<where>
|
|
<where>
|
|
|
u.del_flag = '0'
|
|
u.del_flag = '0'
|
|
|
- <!-- 按积分分类节点及其所有子节点筛选 -->
|
|
|
|
|
|
|
+ <!-- 按积分分类节点及其所有子节点筛选,始终包含扣分标准(id=10)的记录 -->
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR cat.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR cat.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 管理员权限:默认只查看有积分记录的用户 -->
|
|
<!-- 管理员权限:默认只查看有积分记录的用户 -->
|
|
|
<if test="isAdmin != null and isAdmin == 'admin'">
|
|
<if test="isAdmin != null and isAdmin == 'admin'">
|
|
@@ -252,9 +267,9 @@
|
|
|
<if test="ruleType != null">
|
|
<if test="ruleType != null">
|
|
|
AND r.rule_type = #{ruleType}
|
|
AND r.rule_type = #{ruleType}
|
|
|
</if>
|
|
</if>
|
|
|
- <!-- 按积分分类节点及其所有子节点筛选 -->
|
|
|
|
|
|
|
+ <!-- 按积分分类节点及其所有子节点筛选,始终包含扣分标准(id=10)的记录 -->
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 正确日期查询:使用 DATE() 函数 + 直接传 Date 类型 -->
|
|
<!-- 正确日期查询:使用 DATE() 函数 + 直接传 Date 类型 -->
|
|
|
<if test="beginDate != null">
|
|
<if test="beginDate != null">
|
|
@@ -299,9 +314,9 @@
|
|
|
<if test="ruleType != null">
|
|
<if test="ruleType != null">
|
|
|
AND r.rule_type = #{ruleType}
|
|
AND r.rule_type = #{ruleType}
|
|
|
</if>
|
|
</if>
|
|
|
- <!-- 按积分分类节点及其所有子节点筛选 -->
|
|
|
|
|
|
|
+ <!-- 按积分分类节点及其所有子节点筛选,始终包含扣分标准(id=10)的记录 -->
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
<!-- 正确日期查询:使用 DATE() 函数 + 直接传 Date 类型 -->
|
|
<!-- 正确日期查询:使用 DATE() 函数 + 直接传 Date 类型 -->
|
|
|
<if test="beginDate != null">
|
|
<if test="beginDate != null">
|
|
@@ -329,7 +344,7 @@
|
|
|
d.del_flag = '0'
|
|
d.del_flag = '0'
|
|
|
AND d.user_id = #{userId}
|
|
AND d.user_id = #{userId}
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
@@ -343,7 +358,7 @@
|
|
|
d.del_flag = '0'
|
|
d.del_flag = '0'
|
|
|
AND d.user_id = #{userId}
|
|
AND d.user_id = #{userId}
|
|
|
<if test="columnId != null and columnId != ''">
|
|
<if test="columnId != null and columnId != ''">
|
|
|
- AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%'))
|
|
|
|
|
|
|
+ AND (d.category_id = #{columnId} OR c.parent_ids LIKE CONCAT('%,', #{columnId}, ',%') OR d.category_id = '10')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="pointType != null and pointType == 'acquire'">
|
|
<if test="pointType != null and pointType == 'acquire'">
|
|
|
AND d.point > 0
|
|
AND d.point > 0
|
|
@@ -415,7 +430,7 @@
|
|
|
FROM work_knowledge_base_point_detail d
|
|
FROM work_knowledge_base_point_detail d
|
|
|
LEFT JOIN work_knowledge_point_category c ON c.id = d.category_id AND c.del_flag = '0'
|
|
LEFT JOIN work_knowledge_point_category c ON c.id = d.category_id AND c.del_flag = '0'
|
|
|
WHERE d.del_flag = '0'
|
|
WHERE d.del_flag = '0'
|
|
|
- AND (d.category_id = '2' OR c.parent_ids LIKE '%,2,%')
|
|
|
|
|
|
|
+ AND (d.category_id = '2' OR c.parent_ids LIKE '%,2,%' OR d.category_id = '10')
|
|
|
GROUP BY d.user_id
|
|
GROUP BY d.user_id
|
|
|
) cp ON cp.user_id = u.id
|
|
) cp ON cp.user_id = u.id
|
|
|
WHERE u.del_flag = '0'
|
|
WHERE u.del_flag = '0'
|