Enford %!s(int64=5) %!d(string=hai) anos
pai
achega
4f4787308a

+ 207 - 0
src/main/resources/mappings/modules/projectplanweekly/ProjectPlanWeeklyDao.xml

@@ -0,0 +1,207 @@
+<?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="projectPlanWeeklyColumns">
+		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.project_id AS "projectRecords.id",
+		r.project_name AS "projectRecords.projectName"
+	</sql>
+
+	<sql id="projectPlan">
+		i.id AS "id",
+		i.create_by AS "createBy.id",
+		i.create_date AS "createDate",
+		i.update_by AS "updateBy.id",
+		i.update_date AS "updateDate",
+		i.remarks AS "remarks",
+		i.del_flag AS "delFlag",
+		i.begin_date AS "beginDate",
+		i.end_date AS "endDate",
+		i.project_id AS "projectId",
+		i.weekly_status AS "weeklyStatus",
+		i.remarks_status AS "remarksStatus",
+		i.remarks_reason AS "remarksReason",
+		i.project_id AS "projectRecords.id",
+		r.project_name AS "projectRecords.projectName"
+	</sql>
+
+	<select id="get" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly" >
+		SELECT 
+			<include refid="projectPlanWeeklyColumns"/>
+		FROM project_plan_weekly a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly" >
+		SELECT 
+			<include refid="projectPlanWeeklyColumns"/>
+		FROM project_plan_weekly a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="beginDate != null and beginDate != '' and endDate != null and endDate != '' ">
+				AND a.begin_date between #{beginDate} and #{endDate}
+			</if>
+			<if test="endDate != null and endDate != '' and endDate != null and endDate != '' ">
+				AND a.end_date between #{beginDate} and #{endDate}
+			</if>
+			<if test="weeklyTitle != null and weeklyTitle != ''">
+				AND a.weekly_title = #{weeklyTitle}
+			</if>
+			<if test="weeklyStatus != null and weeklyStatus != ''">
+				AND a.weekly_status = #{weeklyStatus}
+			</if>
+			<if test="weeklyText != null and weeklyText != ''">
+				AND a.weekly_text = #{weeklyText}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly" >
+		SELECT 
+			<include refid="projectPlanWeeklyColumns"/>
+		FROM project_plan_weekly a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO project_plan_weekly(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			begin_date,
+			end_date,
+			project_id,
+			weekly_status,
+			remarks_status,
+			remarks_reason
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{beginDate},
+			#{endDate},
+			#{projectId},
+			#{weeklyStatus},
+			#{remarksStatus},
+			#{remarksReason}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE project_plan_weekly SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			begin_date = #{beginDate},
+			end_date = #{endDate},
+			project_id = #{projectId}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM project_plan_weekly
+		WHERE id = #{id}
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE project_plan_weekly SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly" statementType="STATEMENT">
+		select * FROM project_plan_weekly  where ${propertyName} = '${value}'
+	</select>
+
+
+	<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
+	</select>
+
+
+	<update id="saveRemarksReason">
+		UPDATE project_plan_weekly SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks_reason = #{remarksReason}
+		WHERE id = #{id}
+	</update>
+
+	<update id="saveRemarksReasonInfo">
+		UPDATE project_plan_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks_reason = #{remarksReason}
+		WHERE id = #{id}
+	</update>
+
+	<update id="sureWeekly">
+		UPDATE project_plan_weekly SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			weekly_status = #{weeklyStatus}
+		WHERE id = #{id}
+	</update>
+
+	<update id="sureWeeklyInfo">
+		UPDATE project_plan_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			weekly_status = #{weeklyStatus}
+		WHERE id = #{id}
+	</update>
+</mapper>