|
@@ -224,6 +224,69 @@
|
|
|
select * FROM project_plan_weekly where ${propertyName} = '${value}'
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findWeeklyByAdmin" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly">
|
|
|
+ select
|
|
|
+ a.id AS "id",
|
|
|
+ a.create_by AS "createBy.id",
|
|
|
+ a.create_date AS "createDate",
|
|
|
+ a.update_by AS "updateBy.id",
|
|
|
+ a.update_date AS "updateDate",
|
|
|
+ a.remarks AS "remarks",
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
+ a.begin_date AS "beginDate",
|
|
|
+ a.end_date AS "endDate",
|
|
|
+ a.project_id AS "projectId",
|
|
|
+ a.weekly_status AS "weeklyStatus",
|
|
|
+ a.remarks_status AS "remarksStatus",
|
|
|
+ a.remarks_reason AS "remarksReason",
|
|
|
+ a.projectId AS "projectRecords.id",
|
|
|
+ a.project_name AS "projectRecords.projectName",
|
|
|
+ a.company_id as "company.id",
|
|
|
+ a.office_id as "office.id",
|
|
|
+ a.user_id as "projectUserId",
|
|
|
+ a.principal_name as "principalUserName"
|
|
|
+ from(
|
|
|
+ select
|
|
|
+ p.id ,p.create_by ,p.create_date ,p.update_by ,p.update_date ,p.remarks ,p.del_flag ,p.begin_date,p.end_date,p.project_id,p.weekly_status,p.remarks_status,p.remarks_reason,p.project_id as projectId,r.project_name,p.company_id,p.office_id,wpr.user_id,su.name as "principal_name"
|
|
|
+ from project_plan_weekly p
|
|
|
+ left join project_records r on p.project_id = r.id
|
|
|
+ left join work_project_user wpr on wpr.project_id = r.id
|
|
|
+ left join sys_user su on su.id = p.create_by
|
|
|
+ union all
|
|
|
+ select
|
|
|
+ i.id ,i.create_by ,i.create_date ,i.update_by ,i.update_date ,i.remarks ,i.del_flag ,i.begin_date,i.end_date,i.project_id,i.weekly_status,i.remarks_status,i.remarks_reason,i.project_id as projectId,r.project_name,i.company_id,i.office_id,wpr.user_id,su.name as "principal_name"
|
|
|
+ from project_plan_info i
|
|
|
+ left join project_records r on i.project_id = r.id
|
|
|
+ left join work_project_user wpr on wpr.project_id = r.id
|
|
|
+ left join sys_user su on su.id = wpr.user_id
|
|
|
+ where r.status = 5 and r.del_flag=0
|
|
|
+ ) as a
|
|
|
+ left join project_records r on a.project_id = r.id
|
|
|
+ left join work_project_user wpu on wpu.project_id = r.id
|
|
|
+ <where>
|
|
|
+ a.del_flag=0
|
|
|
+ <if test="weeklyStatus !=null and weeklyStatus == 0">
|
|
|
+ AND a.weekly_status = #{weeklyStatus}
|
|
|
+ and (a.end_date <= #{endDate} or #{endDate} between a.begin_date and a.end_date )
|
|
|
+ </if>
|
|
|
+ <if test="weeklyStatus !=null and weeklyStatus == 1">
|
|
|
+ AND a.weekly_status = #{weeklyStatus}
|
|
|
+ and (#{beginDate} between a.begin_date and a.end_date
|
|
|
+ or #{endDate} between a.begin_date and a.end_date
|
|
|
+ or (a.begin_date >=#{beginDate} and a.end_date <=#{endDate})
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY wpu.user_id asc,a.begin_date asc,a.end_date asc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
<select id="findWeekly" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly">
|
|
|
select
|