<?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="cn.com.countrygarden.bi.main.dao.project.TbDupContractTimedEmergencyMapper">
 
  <resultMap type="cn.com.countrygarden.bi.main.model.project.TbDupContractTimedEmergency" id="contractTimedExecuteMap">
  	<result column="start_date" property="startDate"/>
  	<result column="create_date" property="createDate"/>
  	<result column="end_date" property="endDate"/>
  </resultMap>
  
  <!--查询调度时间  -->
  <select id="findDateStart" resultMap="contractTimedExecuteMap">
   SELECT
		tb_dup_contract_timed_emergency.create_date,
		tb_dup_contract_timed_emergency.end_date,
		tb_dup_contract_timed_emergency.start_date
	FROM
		tb_dup_contract_timed_emergency
	ORDER BY
		tb_dup_contract_timed_emergency.create_date DESC
	limit 0,1	
  </select>
  
  <!-- 插入调度时间 -->
  <insert id="insterContractTimedExecute" parameterType="cn.com.countrygarden.bi.main.model.project.TbDupContractTimedEmergency">
  		INSERT INTO tb_dup_contract_timed_emergency (
			`start_date`,
			`end_date`,
			`create_by`,
			`create_date`
		)
		VALUES
			(
				#{startDate},
				#{endDate},
				'sys',
				#{createDate}
			)
  </insert>
</mapper>