<?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.ruoyi.bgt.mapper.BgtProjectRecruitMapper">

    <resultMap type="com.ruoyi.bgt.domain.BgtProjectRecruit" id="BgtProjectRecruitResult">
        <result property="id" column="id"/>
        <result property="projectId" column="project_id"/>
        <result property="sectionId" column="section_id"/>
        <result property="subId" column="sub_id"/>
        <result property="taskId" column="task_id"/>
        <result property="recruitName" column="recruit_name"/>
        <result property="recruitAddress" column="recruit_address"/>
        <result property="recruitAmount" column="recruit_amount"/>
        <result property="recruitStaffNum" column="recruit_staff_num"/>
        <result property="recruitBeginTime" column="recruit_begin_time"/>
        <result property="recruitContactPerson" column="recruit_contact_person"/>
        <result property="recruitContactPhone" column="recruit_contact_phone"/>
        <result property="subDescribe" column="sub_describe"/>
        <result property="recruitRequirement" column="recruit_requirement"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <select id="appQueryPageList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitVO">
        select bpr.id,bpr.recruit_name,bpr.recruit_address,bpr.recruit_amount,bpr.recruit_staff_num,bpr.recruit_requirement,bpr.create_time,fpt.task_name
        from bgt_project_recruit bpr left join fbs_project_task  fpt on bpr.task_id = fpt.id
        <where>
            <if test="dto.user_id != null ">
               and bpr.user_id = #{dto.userId}
            </if>
            <if test="dto.recruitName != null  and dto.recruitName != ''">
               and bpr.recruit_name like concat('%', #{dto.recruitName}, '%')
            </if>
        </where>
    </select>

</mapper>
