|
|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.project.plant.mapper.TEoegDailyManagementMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TEoegDailyManagement" id="TEoegDailyManagementResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="year" column="year" />
|
|
|
@@ -36,22 +36,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="deptId" column="dept_id" />
|
|
|
<result property="remarks" column="remarks" />
|
|
|
<result property="deptName" column="dept_name" />
|
|
|
+ <result property="isRelatedToMe" column="is_related_to_me" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTEoegDailyManagementVo">
|
|
|
- select d.id, d.year, d.start_month, d.end_month, d.rc_code, d.subject, d.work_content, d.responsible_person, d.frequency, d.standard, d.finish_status, d.q1_jan, d.q1_feb, d.q1_mar, d.q2_apr, d.q2_may, d.q2_jun, d.q3_jul, d.q3_aug, d.q3_sep, d.q4_oct, d.q4_nov, d.q4_dec, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_eoeg_daily_management d
|
|
|
- left join sys_dept s on s.dept_id = d.dept_id
|
|
|
+ select d.id, d.year, d.start_month, d.end_month, d.rc_code, d.subject, d.work_content, d.responsible_person, d.frequency, d.standard, d.finish_status, d.q1_jan, d.q1_feb, d.q1_mar, d.q2_apr, d.q2_may, d.q2_jun, d.q3_jul, d.q3_aug, d.q3_sep, d.q4_oct, d.q4_nov, d.q4_dec, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, s.dept_name
|
|
|
+ <if test="currentUserStaffId != null and currentUserStaffId != ''">
|
|
|
+ , case when d.responsible_person like '%' || #{currentUserStaffId} || '%' then '1' else '0' end as is_related_to_me
|
|
|
+ </if>
|
|
|
+ <if test="currentUserStaffId == null or currentUserStaffId == ''">
|
|
|
+ , '0' as is_related_to_me
|
|
|
+ </if>
|
|
|
+ from t_eoeg_daily_management d
|
|
|
+ left join sys_dept s on s.dept_id = d.dept_id
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTEoegDailyManagementList" parameterType="TEoegDailyManagement" resultMap="TEoegDailyManagementResult">
|
|
|
<include refid="selectTEoegDailyManagementVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
<if test="startMonth != null and startMonth != ''"> and start_month = #{startMonth}</if>
|
|
|
<if test="endMonth != null and endMonth != ''"> and end_month = #{endMonth}</if>
|
|
|
- <if test="rcCode != null and rcCode != ''"> and rc_code = #{rcCode}</if>
|
|
|
- <if test="subject != null and subject != ''"> and subject = #{subject}</if>
|
|
|
- <if test="workContent != null and workContent != ''"> and work_content = #{workContent}</if>
|
|
|
+ <if test="rcCode != null and rcCode != ''"> and rc_code like '%' || #{rcCode} || '%'</if>
|
|
|
+ <if test="subject != null and subject != ''"> and subject like '%' || #{subject} || '%'</if>
|
|
|
+ <if test="workContent != null and workContent != ''"> and work_content like '%' || #{workContent} || '%'</if>
|
|
|
<if test="responsiblePerson != null and responsiblePerson != ''"> and responsible_person = #{responsiblePerson}</if>
|
|
|
<if test="frequency != null and frequency != ''"> and frequency = #{frequency}</if>
|
|
|
<if test="standard != null and standard != ''"> and standard = #{standard}</if>
|
|
|
@@ -79,12 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTEoegDailyManagementById" parameterType="Long" resultMap="TEoegDailyManagementResult">
|
|
|
<include refid="selectTEoegDailyManagementVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertTEoegDailyManagement" parameterType="TEoegDailyManagement">
|
|
|
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
|
SELECT seq_t_eoeg_daily_management.NEXTVAL as id FROM DUAL
|
|
|
@@ -203,4 +211,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
-</mapper>
|
|
|
+ <select id="selectTEoegDailyManagementDashboardList" parameterType="TEoegDailyManagement" resultMap="TEoegDailyManagementResult">
|
|
|
+ select d.id, d.year, d.start_month, d.end_month, d.rc_code, d.subject, d.work_content, d.responsible_person,
|
|
|
+ d.frequency, d.standard, d.finish_status, d.q1_jan, d.q1_feb, d.q1_mar, d.q2_apr, d.q2_may, d.q2_jun,
|
|
|
+ d.q3_jul, d.q3_aug, d.q3_sep, d.q4_oct, d.q4_nov, d.q4_dec, d.del_flag, d.creater_code, d.createdate,
|
|
|
+ d.updater_code, d.updatedate, d.dept_id, d.remarks, s.dept_name
|
|
|
+ <if test="currentUserStaffId != null and currentUserStaffId != ''">
|
|
|
+ , case when d.responsible_person like '%' || #{currentUserStaffId} || '%' then '1' else '0' end as is_related_to_me
|
|
|
+ </if>
|
|
|
+ <if test="currentUserStaffId == null or currentUserStaffId == ''">
|
|
|
+ , '0' as is_related_to_me
|
|
|
+ </if>
|
|
|
+ from t_eoeg_daily_management d
|
|
|
+ left join sys_dept s on s.dept_id = d.dept_id
|
|
|
+ <where>
|
|
|
+ <if test="year != null and year != ''"> and d.year = #{year}</if>
|
|
|
+ <if test="rcCode != null and rcCode != ''"> and d.rc_code like '%' || #{rcCode} || '%'</if>
|
|
|
+ <if test="subject != null and subject != ''"> and d.subject like '%' || #{subject} || '%'</if>
|
|
|
+ <if test="workContent != null and workContent != ''"> and d.work_content like '%' || #{workContent} || '%'</if>
|
|
|
+ <if test="finishStatus != null and finishStatus != ''"> and d.finish_status = #{finishStatus}</if>
|
|
|
+ and d.del_flag = 0
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ <if test="currentUserStaffId != null and currentUserStaffId != ''">
|
|
|
+ case when d.responsible_person like '%' || #{currentUserStaffId} || '%' then 0 else 1 end,
|
|
|
+ </if>
|
|
|
+ case when d.finish_status = '0' then 0 else 1 end,
|
|
|
+ d.id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|