<?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.sqx.modules.resumes.dao.ResumesPushDao">

    <select id="selectResumesPushList" resultType="com.sqx.modules.resumes.entity.ResumesPush">
        select p.* from resumes_push p
        left join resumes s on p.resumes_id=s.resumes_id
        left join post_push ph on ph.post_push_id=p.post_push_id
        left join company c on c.company_id=ph.company_id
        where s.resumes_id is not null
        <if test="userId!=null">
            and s.user_id=#{userId}
        </if>
        <if test="resumesName!=null and resumesName!=''">
            and s.resumes_name like concat('%',#{resumesName},'%')
        </if>
        <if test="resumesPhone!=null and resumesPhone!=''">
            and s.resumes_phone like concat('%',#{resumesPhone},'%')
        </if>
        <if test="classify!=null">
            and p.classify=#{classify}
        </if>
        <if test="postPushId!=null">
            and p.post_push_id=#{postPushId}
        </if>
        <if test="postDetailsId!=null">
            and p.post_details_id=#{postDetailsId}
        </if>
        <if test="status!=null">
            and p.status=#{status}
        </if>
        <if test="resumesMajor!=null and resumesMajor!=''">
            and s.resumes_major like concat('%',#{resumesMajor},'%')
        </if>
        <if test="resumesPost!=null and resumesPost!=''">
            and s.resumes_post like concat('%',#{resumesPost},'%')
        </if>
        <if test="resumesWorkExperience!=null and resumesWorkExperience!=''">
            and s.resumes_work_experience like concat('%',#{resumesWorkExperience},'%')
        </if>

        <if test="isRecommend!=null and isRecommend!=0">
            and s.is_recommend=#{isRecommend}
        </if>
        <if test="resumesEducation!=null and resumesEducation!=''">
            and s.resumes_education like concat('%',#{resumesEducation},'%')
        </if>
        <if test="resumesMarriage!=null and resumesMarriage!=''">
            and s.resumes_marriage like concat('%',#{resumesMarriage},'%')
        </if>
        <if test="rulePostName!=null and rulePostName!=''">
            and s.rule_post_name like concat('%',#{rulePostName},'%')
        </if>
        <if test="resumesCompensation!=null and resumesCompensation!=''">
            and s.resumes_compensation like concat('%',#{resumesCompensation},'%')
        </if>
        <if test="resumesAge!=null and resumesAge!=''">
            and s.resumes_age=#{resumesAge}
        </if>
        <if test="companyName!=null and companyName!=''">
            and c.company_name like concat('%',#{companyName},'%')
        </if>
        <if test="ruleClassifyId!=null">
            and ph.rule_classify_id = #{ruleClassifyId}
        </if>
        <if test="projectAward!=null and projectAward!=''">
            and ph.project_award like concat('%',#{projectAward},'%')
        </if>
        <if test="ruleClassifyName!=null and ruleClassifyName!=''">
            and ph.rule_classify_name like concat('%',#{ruleClassifyName},'%')
        </if>

        order by p.create_time desc
    </select>


</mapper>