PositionAloneInfoMapper.xml 3.08 KB
<?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.laowu.mapper.PositionAloneInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.laowu.model.PositionAloneInfoDO">
        <id column="id" property="id" />
        <result column="create_date" property="createDate" />
        <result column="update_date" property="updateDate" />
        <result column="delete_date" property="deleteDate" />
        <result column="company_id" property="companyId" />
        <result column="position_status" property="positionStatus" />
        <result column="position_name" property="positionName" />
        <result column="recruit_type" property="recruitType" />
        <result column="province" property="province" />
        <result column="city" property="city" />
        <result column="county" property="county" />
        <result column="job_sort_id" property="jobSortId" />
        <result column="position_id" property="positionId" />
        <result column="job_id" property="jobId" />
        <result column="position_desc" property="positionDesc" />
        <result column="position_require" property="positionRequire" />
        <result column="start_salary" property="startSalary" />
        <result column="end_salary" property="endSalary" />
    </resultMap>


    <select id="aloneRequirements" resultType="com.laowu.vo.position.AloneRequirementsVO">
        SELECT
        t.id,
        company_id,
        t2.company_name,
        position_status,
        require_counts,
        position_name,
        recruit_type,
        t.province,
        t.city,
        t.county,
        job_sort_id,
        t3.job_name,
        t4.position_type,
        t.position_id,
        job_id,
        position_desc,
        position_require,
        start_salary,
        end_salary,
        t.address
        FROM
        position_alone_info t
        LEFT JOIN company_dict t2 ON t.company_id = t2.id AND t2.delete_date IS NULL
        LEFT JOIN lib_job_sort t3 ON t.job_sort_id = t3.id and t3.delete_date IS NULL
        LEFT JOIN position_dict t4 ON t.position_id = t4.id  and t4.delete_date IS NULL
        WHERE
            t.delete_date IS NULL
            and t.origin_id is null
            <if test="positionStatus!= null and positionStatus!=''">
                AND t.position_status = #{positionStatus}
            </if>
            <if test="positionName != null and positionName != ''">
                AND t.position_name LIKE concat('%', #{positionName}, '%')
            </if>
            <if test="positionId != null and positionId != ''">
                AND t.position_id = #{positionId}
            </if>
            <if test="province != null and province !=''">
                AND t.province = #{province}
            </if>
            <if test="city != null and city != ''">
                AND t.city = #{city}
            </if>
            <if test="county != null and county != ''">
                AND t.county = #{county}
            </if>
    </select>

</mapper>