<?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.test.program.configuration.projectList.mapper.ProjectListMapper">

   <select id="findContractPageList" resultType="com.jeeplus.test.workContract.domain.WorkContractInfo">
       SELECT
            a.id,
            a.create_date,
            a.update_by,
            a.update_date,
            a.del_flag,
            a.client_id,
            a.client_name,
            a.no,
            a.name,
            a.contract_date,
            a.effective_date,
            a.closing_date,
            a.contract_type,
            a.contract_amount_type,
            a.contract_amount,
            a.contract_opposite,
            a.contract_fee,
            a.fees,
            a.describes,
            a.contract_special,
            a.remarks,
            a.filed_by,
            a.filed_date,
            a.filed_no,
            a.confirm_filed_no,
            a.filed_remarks,
            a.proc_ins_id,
            a.process_definition_id,
            a.status,
            a.filed_type,
            a.borrow_type,
            b.NAME AS create_by
        FROM
            work_contract_info a
            LEFT JOIN sys_user b ON a.create_by = b.id
        WHERE
            a.del_flag = 0
            <if test="dto.createBy != null and dto.createBy != ''">
                AND b.id = #{dto.createBy}
            </if>
           <if test="dto.name != null and dto.name != ''">
               AND a.name LIKE CONCAT ('%', #{dto.name}, '%')
           </if>
           <if test="dto.clientName != null and dto.clientName != ''">
               AND a.client_name LIKE CONCAT ('%', #{dto.clientName}, '%')
           </if>
            ORDER BY a.create_by DESC
   </select>

    <update id="updateStatusById">
        UPDATE program_project_list_info SET `status` = #{status} WHERE id = #{id}
    </update>

    <select id="findPageList" resultType="com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo">
        SELECT
            a.id,
            b.name AS create_by,
            a.create_date,
            a.update_by,
            a.update_date,
            a.del_flag,
            a.contract_id,
            a.contract_name,
            a.client,
            a.amount,
            a.contract_type,
            a.name,
            a.no,
            a.project_type,
            a.company,
            a.property_holder,
            a.location,
            a.is_first,
            a.year_num,
            a.check_year,
            a.project_manager,
            a.report_type,
            a.industry,
            a.enterprise_type,
            a.risk_level,
            a.project_source,
            a.estimate,
            a.plan_end_time,
            a.use_num,
            a.appointment,
            a.work_hours,
            a.remarks,
            a.assessment_enterprise,
            a.link_num,
            a.relationship,
            a.assessment_way,
            a.assessment_objective,
            a.assessment_date,
            a.num,
            a.project_development,
            a.delegate_project_type,
            a.assessment_object,
            a.work_begin_date,
            a.work_end_date,
            a.reporting_date,
            a.is_have,
            a.is_influence,
            a.mode,
            a.status
        FROM
            program_project_list_info a
            LEFT JOIN sys_user b ON a.create_by = b.id
            ${ew.customSqlSegment}
            ORDER BY a.update_date DESC
    </select>

</mapper>
