|
@@ -0,0 +1,235 @@
|
|
|
+<?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.workcontent.dao.WorkScheduleDao">
|
|
|
+
|
|
|
+ <sql id="workPreliminaryDesignEstimateColumns">
|
|
|
+ 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.project_id AS "projectId",
|
|
|
+ a.content_id AS "contentId",
|
|
|
+ a.contract_money as "contractMoney",
|
|
|
+ a.before_cumulative_completion_money as "beforeCumulativeCompletionMoney",
|
|
|
+ a.before_total_payment_money as "beforeTotalPaymentMoney",
|
|
|
+ a.before_pay_ratio as "beforePayRatio",
|
|
|
+ a.current_accomplish_money as "currentAccomplishMoney",
|
|
|
+ a.current_appoint_pay_money as "currentAppointPayMoney",
|
|
|
+ a.current_should_deduct_prepay_money as "currentShouldDeductPrepayMoney",
|
|
|
+ a.current_should_deduct_money as "currentShouldDeductMoney",
|
|
|
+ a.current_practical_pay_money as "currentPracticalPayMoney",
|
|
|
+ a.current_cumulative_completion_money as "currentCumulativeCompletionMoney",
|
|
|
+ a.current_total_payment_money as "currentTotalPaymentMoney",
|
|
|
+ a.current_pay_ratio as "currentPayRatio",
|
|
|
+ a.type as "type"
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="get" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workPreliminaryDesignEstimateColumns"/>
|
|
|
+ FROM work_schedule_info a
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findList" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workPreliminaryDesignEstimateColumns"/>
|
|
|
+ FROM work_schedule_info a
|
|
|
+ <where>
|
|
|
+ <if test="projectId!=null and projectId !=''">
|
|
|
+ AND a.project_id = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="contentId!=null and contentId !=''">
|
|
|
+ AND a.content_id = #{contentId}
|
|
|
+ </if>
|
|
|
+ AND 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>
|
|
|
+
|
|
|
+ <select id="findAllList" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workPreliminaryDesignEstimateColumns"/>
|
|
|
+ FROM work_schedule_info 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 work_schedule_info(
|
|
|
+ id,
|
|
|
+ create_by,
|
|
|
+ create_date,
|
|
|
+ update_by,
|
|
|
+ update_date,
|
|
|
+ remarks,
|
|
|
+ del_flag,
|
|
|
+ project_id,
|
|
|
+ content_id,
|
|
|
+ contract_money,
|
|
|
+ before_cumulative_completion_money,
|
|
|
+ before_total_payment_money,
|
|
|
+ before_pay_ratio,
|
|
|
+ current_accomplish_money,
|
|
|
+ current_appoint_pay_money,
|
|
|
+ current_should_deduct_prepay_money,
|
|
|
+ current_should_deduct_money,
|
|
|
+ current_practical_pay_money,
|
|
|
+ current_cumulative_completion_money,
|
|
|
+ current_total_payment_money,
|
|
|
+ current_pay_ratio,
|
|
|
+ type
|
|
|
+ ) VALUES (
|
|
|
+ #{id},
|
|
|
+ #{createBy.id},
|
|
|
+ #{createDate},
|
|
|
+ #{updateBy.id},
|
|
|
+ #{updateDate},
|
|
|
+ #{remarks},
|
|
|
+ #{delFlag},
|
|
|
+ #{projectId},
|
|
|
+ #{contentId},
|
|
|
+ #{contractMoney},
|
|
|
+ #{beforeCumulativeCompletionMoney},
|
|
|
+ #{beforeTotalPaymentMoney},
|
|
|
+ #{beforePayRatio},
|
|
|
+ #{currentAccomplishMoney},
|
|
|
+ #{currentAppointPayMoney},
|
|
|
+ #{currentShouldDeductPrepayMoney},
|
|
|
+ #{currentShouldDeductMoney},
|
|
|
+ #{currentPracticalPayMoney},
|
|
|
+ #{currentCumulativeCompletionMoney},
|
|
|
+ #{currentTotalPaymentMoney},
|
|
|
+ #{currentPayRatio},
|
|
|
+ #{type}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
+ INSERT INTO work_schedule_info(
|
|
|
+ id,
|
|
|
+ create_by,
|
|
|
+ create_date,
|
|
|
+ update_by,
|
|
|
+ update_date,
|
|
|
+ remarks,
|
|
|
+ del_flag,
|
|
|
+ project_id,
|
|
|
+ content_id,
|
|
|
+ contract_money,
|
|
|
+ before_cumulative_completion_money,
|
|
|
+ before_total_payment_money,
|
|
|
+ before_pay_ratio,
|
|
|
+ current_accomplish_money,
|
|
|
+ current_appoint_pay_money,
|
|
|
+ current_should_deduct_prepay_money,
|
|
|
+ current_should_deduct_money,
|
|
|
+ current_practical_pay_money,
|
|
|
+ current_cumulative_completion_money,
|
|
|
+ current_total_payment_money,
|
|
|
+ current_pay_ratio,
|
|
|
+ type
|
|
|
+ ) VALUES
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ ( #{item.id},
|
|
|
+ #{item.createBy.id},
|
|
|
+ #{item.createDate},
|
|
|
+ #{item.updateBy.id},
|
|
|
+ #{item.updateDate},
|
|
|
+ #{item.remarks},
|
|
|
+ #{item.delFlag},
|
|
|
+ #{item.projectId},
|
|
|
+ #{item.contentId},
|
|
|
+ #{item.contractMoney},
|
|
|
+ #{item.beforeCumulativeCompletionMoney},
|
|
|
+ #{item.beforeTotalPaymentMoney},
|
|
|
+ #{item.beforePayRatio},
|
|
|
+ #{item.currentAccomplishMoney},
|
|
|
+ #{item.currentAppointPayMoney},
|
|
|
+ #{item.currentShouldDeductPrepayMoney},
|
|
|
+ #{item.currentShouldDeductMoney},
|
|
|
+ #{item.currentPracticalPayMoney},
|
|
|
+ #{item.currentCumulativeCompletionMoney},
|
|
|
+ #{item.currentTotalPaymentMoney},
|
|
|
+ #{item.currentPayRatio},
|
|
|
+ #{item.type}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update">
|
|
|
+ UPDATE work_schedule_info SET
|
|
|
+ update_by = #{updateBy.id},
|
|
|
+ update_date = #{updateDate},
|
|
|
+ remarks = #{remarks},
|
|
|
+ del_flag = #{delFlag},
|
|
|
+ project_id = #{projectId},
|
|
|
+ content_id = #{contentId},
|
|
|
+ contract_money = #{contractMoney},
|
|
|
+ before_cumulative_completion_money = #{beforeCumulativeCompletionMoney},
|
|
|
+ before_total_payment_money = #{beforeTotalPaymentMoney},
|
|
|
+ before_pay_ratio = #{beforePayRatio},
|
|
|
+ current_accomplish_money = #{currentAccomplishMoney},
|
|
|
+ current_appoint_pay_money = #{currentAppointPayMoney},
|
|
|
+ current_should_deduct_prepay_money = #{currentShouldDeductPrepayMoney},
|
|
|
+ current_should_deduct_money = #{currentShouldDeductMoney},
|
|
|
+ current_practical_pay_money = #{currentPracticalPayMoney},
|
|
|
+ current_cumulative_completion_money = #{currentCumulativeCompletionMoney},
|
|
|
+ current_total_payment_money = #{currentTotalPaymentMoney},
|
|
|
+ current_pay_ratio = #{currentPayRatio},
|
|
|
+ type = #{type}
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <!--物理删除-->
|
|
|
+ <update id="delete">
|
|
|
+ DELETE FROM work_schedule_info
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--逻辑删除-->
|
|
|
+ <update id="deleteByLogic">
|
|
|
+ UPDATE work_schedule_info SET
|
|
|
+ del_flag = #{DEL_FLAG_DELETE}
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteByContentId">
|
|
|
+ DELETE FROM work_schedule_info
|
|
|
+ WHERE content_id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
|
+ <select id="findUniqueByProperty" resultType="com.jeeplus.modules.workcontent.entity.WorkScheduleInfo" statementType="STATEMENT">
|
|
|
+ select * FROM work_schedule_info where ${propertyName} = '${value}'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTableType" resultType="java.lang.String">
|
|
|
+ select a.type from(
|
|
|
+ select DISTINCT(wpde.type) as type from work_schedule_info wpde where wpde.del_flag = 0 and wpde.content_id = #{contentId}
|
|
|
+ ) a
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|