|
@@ -1,7 +1,27 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.jeeplus.modules.projectplanweekly.dao.ProjectPlanWeeklyDao">
|
|
|
-
|
|
|
+
|
|
|
+ <sql id="projectPlanWeeklyAndPlanColumns">
|
|
|
+ ppw.id AS "id",
|
|
|
+ ppw.create_by AS "createBy.id",
|
|
|
+ ppw.create_date AS "createDate",
|
|
|
+ ppw.update_by AS "updateBy.id",
|
|
|
+ ppw.update_date AS "updateDate",
|
|
|
+ ppw.remarks AS "remarks",
|
|
|
+ ppw.del_flag AS "delFlag",
|
|
|
+ ppw.begin_date AS "beginDate",
|
|
|
+ ppw.end_date AS "endDate",
|
|
|
+ ppw.project_id AS "projectId",
|
|
|
+ ppw.weekly_status AS "weeklyStatus",
|
|
|
+ ppw.remarks_status AS "remarksStatus",
|
|
|
+ ppw.remarks_reason AS "remarksReason",
|
|
|
+ ppw.projectId AS "projectRecords.id",
|
|
|
+ ppw.project_name AS "projectRecords.projectName",
|
|
|
+ ppw.company_id as "company.id",
|
|
|
+ ppw.office_id as "office.id"
|
|
|
+ </sql>
|
|
|
+
|
|
|
<sql id="projectPlanWeeklyColumns">
|
|
|
a.id AS "id",
|
|
|
a.create_by AS "createBy.id",
|
|
@@ -17,7 +37,9 @@
|
|
|
a.remarks_status AS "remarksStatus",
|
|
|
a.remarks_reason AS "remarksReason",
|
|
|
a.project_id AS "projectRecords.id",
|
|
|
- r.project_name AS "projectRecords.projectName"
|
|
|
+ r.project_name AS "projectRecords.projectName",
|
|
|
+ a.company_id as company.id,
|
|
|
+ a.office_id as office.id
|
|
|
</sql>
|
|
|
|
|
|
<sql id="projectPlan">
|
|
@@ -36,6 +58,8 @@
|
|
|
i.remarks_reason AS "remarksReason",
|
|
|
i.project_id AS "projectRecords.id",
|
|
|
r.project_name AS "projectRecords.projectName"
|
|
|
+ i.company_id as company.id,
|
|
|
+ i.office_id as office.id
|
|
|
</sql>
|
|
|
|
|
|
<select id="get" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly" >
|
|
@@ -160,16 +184,60 @@
|
|
|
|
|
|
<select id="findWeekly" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly">
|
|
|
select
|
|
|
- <include refid="projectPlanWeeklyColumns"/>
|
|
|
- from
|
|
|
- project_plan_weekly a
|
|
|
- left join project_records r on a.project_id = r.id
|
|
|
- union all
|
|
|
- select
|
|
|
- <include refid="projectPlan"/>
|
|
|
- from
|
|
|
- project_plan_info i
|
|
|
- left join project_records r on i.project_id = r.id
|
|
|
+ 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"
|
|
|
+ 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
|
|
|
+ from
|
|
|
+ project_plan_weekly p
|
|
|
+ left join project_records r on p.project_id = r.id
|
|
|
+ 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
|
|
|
+ from
|
|
|
+ project_plan_info i
|
|
|
+ left join project_records r on i.project_id = r.id
|
|
|
+ ) 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>
|
|
|
+
|
|
|
+ <if test="weeklyStatus !=null and weeklyStatus == '0'">
|
|
|
+ AND a.weekly_status = #{weeklyStatus}
|
|
|
+ and a.end_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="weeklyStatus !=null and weeklyStatus == '1'">
|
|
|
+ AND a.weekly_status = #{weeklyStatus}
|
|
|
+ and a.begin_date >= #{beginDate} and a.begin_date <= #{endDate}
|
|
|
+ and a.end_date >= #{endDate}
|
|
|
+ </if>
|
|
|
+ (wpu.user_id = #{currentUser.id} ${sqlMap.dsf}) and
|
|
|
+ r.status = 5 and r.del_flag=0
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.weekly_status asc,a.begin_date asc,a.end_date asc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</select>
|
|
|
|
|
|
|