|
@@ -0,0 +1,120 @@
|
|
|
+<?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.ozs.plan.mapper.PlanOfYearsMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ozs.plan.doman.PlanOfYears" id="PlanOfYearsResult">
|
|
|
+ <id property="plan_year_id" column="planYearId"/>
|
|
|
+ <result property="purchase_unit" column="purchaseUnit"/>
|
|
|
+ <result property="project_name" column="projectName"/>
|
|
|
+ <result property="project_type" column="projectType"/>
|
|
|
+ <result property="demand_overview" column="demandOverview"/>
|
|
|
+ <result property="evaluation" column="evaluation"/>
|
|
|
+ <result property="is_excess" column="isExcess"/>
|
|
|
+ <result property="purchase_services" column="purchaseServices"/>
|
|
|
+ <result property="purchase_mode" column="purchaseMode"/>
|
|
|
+ <result property="demand_commit_time" column="demandCommitTime"/>
|
|
|
+ <result property="purchase_finish_time" column="purchaseFinishTime"/>
|
|
|
+ <result property="deliver_time" column="deliverTime"/>
|
|
|
+ <result property="project_attribute" column="projectAttribute"/>
|
|
|
+ <result property="readjust_of_plan" column="readjustOfPlan"/>
|
|
|
+ <result property="remarks" column="remarks"/>
|
|
|
+ <result property="project_status" column="projectStatus"/>
|
|
|
+ <result property="create_by" column="createBy"/>
|
|
|
+ <result property="create_time" column="createTime"/>
|
|
|
+ <result property="is_delete" column="isDelete"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <update id="updateById" parameterType="com.ozs.plan.doman.PlanOfYears">
|
|
|
+ update plan_of_years
|
|
|
+ set purchase_unit=#{purchaseUnit},
|
|
|
+ project_name=#{projectName},
|
|
|
+ project_type=#{projectType},
|
|
|
+ demand_overview=#{demandOverview},
|
|
|
+ evaluation=#{evaluation},
|
|
|
+ is_excess=#{isExcess},
|
|
|
+ purchase_services=#{purchaseServices},
|
|
|
+ purchase_mode=#{purchaseMode},
|
|
|
+ demand_commit_time=#{demandCommitTime},
|
|
|
+ purchase_finish_time=#{purchaseFinishTime},
|
|
|
+ deliver_time=#{deliverTime},
|
|
|
+ project_attribute=#{projectAttribute},
|
|
|
+ readjust_of_plan=#{readjustOfPlan},
|
|
|
+ remarks=#{remarks},
|
|
|
+ project_status=#{projectStatus}
|
|
|
+ where plan_year_id = #{planYearId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectPlanOfYearsList" parameterType="com.ozs.plan.doman.PlanOfYears" resultMap="PlanOfYearsResult">
|
|
|
+ select * from plan_of_years
|
|
|
+ <where>
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
+ AND project_name like concat('%', #{projectName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="purchaseServices != null and purchaseServices != ''">
|
|
|
+ AND purchase_services = #{purchaseServices}
|
|
|
+ </if>
|
|
|
+ <if test="isExcess != null and isExcess != ''">
|
|
|
+ AND is_excess like = #{isExcess}
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus != null and projectStatus != ''">
|
|
|
+ AND project_status = #{projectStatus}
|
|
|
+ </if>
|
|
|
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
+ and date_format(demand_commit_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ and date_format(demand_commit_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countProjectName" resultType="java.lang.Integer" parameterType="java.lang.String">
|
|
|
+ select count(plan_of_years.plan_year_id)
|
|
|
+ from plan_of_years
|
|
|
+ where project_name = #{projectName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getById" resultType="com.ozs.plan.doman.PlanOfYears" parameterType="java.lang.Long">
|
|
|
+ select *
|
|
|
+ from plan_of_years
|
|
|
+ where plan_year_id = #{planYearId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countProjectNameOther" resultType="java.lang.Integer" parameterType="java.lang.String">
|
|
|
+ select count(plan_of_years.plan_year_id)
|
|
|
+ from plan_of_years
|
|
|
+ where project_name = #{projectName}
|
|
|
+ and plan_year_id != #{planYearId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertPlanOfYears" parameterType="com.ozs.plan.doman.PlanOfYears">
|
|
|
+ insert into plan_of_years (purchase_unit, project_name, project_type, demand_overview, evaluation, is_excess,
|
|
|
+ purchase_services, purchase_mode, demand_commit_time, purchase_finish_time,
|
|
|
+ deliver_time, project_attribute, readjust_of_plan, remarks, project_status,
|
|
|
+ create_by, create_time, is_delete)
|
|
|
+ values (#{purchaseUnit}, #{projectName}, #{projectType}, #{demandOverview}, #{evaluation}, #{isExcess},
|
|
|
+ #{purchaseServices}, #{purchaseMode}, #{demandCommitTime}, #{purchaseFinishTime}, #{deliverTime},
|
|
|
+ #{projectAttribute}, #{readjustOfPlan}, #{remarks}, #{projectStatus}, #{createBy}, #{createTime}, 0)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="deletePlanOfYearsByIds" parameterType="java.lang.Long">
|
|
|
+ update plan_of_years set is_delete=1 where plan_year_id in
|
|
|
+ <foreach collection="array" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deletePlanOfYearsById" parameterType="java.lang.Long">
|
|
|
+ update plan_of_years
|
|
|
+ set is_delete=1
|
|
|
+ where plan_year_id = #{plan_year_id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- <update id="cleanLogininfor">-->
|
|
|
+ <!-- truncate table sys_logininfor-->
|
|
|
+ <!-- </update>-->
|
|
|
+
|
|
|
+</mapper>
|