<?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.chushang.inspection.project.mapper.WrkProjectContractMapper">
  <resultMap id="BaseResultMap" type="com.chushang.inspection.project.po.WrkProjectContract">
    <!--@mbg.generated-->
    <!--@Table wrk_project_contract-->
    <id column="contract_id" jdbcType="BIGINT" property="contractId" />
    <result column="project_id" jdbcType="BIGINT" property="projectId" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="contract_url" jdbcType="VARCHAR" property="contractUrl" />
    <result column="contract_start_time" jdbcType="TIMESTAMP" property="contractStartTime" />
    <result column="contract_end_time" jdbcType="TIMESTAMP" property="contractEndTime" />
    <result column="contract_amount" jdbcType="DECIMAL" property="contractAmount" />
    <result column="audit_status" jdbcType="SMALLINT" property="auditStatus" />
    <result column="project_effect" jdbcType="SMALLINT" property="projectEffect" />
    <result column="payment_state" jdbcType="SMALLINT" property="paymentState" />
    <result column="version" jdbcType="BIGINT" property="version" />
    <result column="del_state" jdbcType="BOOLEAN" property="delState" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    contract_id, project_id, remark, contract_url, contract_start_time, contract_end_time,
    contract_amount, audit_status, project_effect, payment_state, version, del_state,
    create_by, create_time, update_by, update_time
  </sql>


  <select id="queryListByProjectIds" resultMap="BaseResultMap" parameterType="java.util.List">
    select <include refid="Base_Column_List" />  from wrk_project_contract
    WHERE del_state = 0 AND project_id = #{projectId} order by create_time desc limit 1
  </select>
</mapper>
