WorkstationAloneMappingMapper.xml 3.55 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.WorkstationAloneMappingMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.laowu.model.WorkstationAloneMappingDO">
        <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="station_id" property="stationId" />
        <result column="alone_id" property="aloneId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, station_id, alone_id
    </sql>

    <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,
            t5.station_id,
            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
        left join workstation_alone_mapping t5 on t5.alone_id = t.id         and t5.delete_date IS NULL
        WHERE
        t.delete_date 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>
        <if test="stationId != null and stationId != ''">
            and t5.station_id = #{stationId}
        </if>
        <if test="stationId == null ">
            and t.origin_id is null
        </if>
    </select>

    <select id="requiresStations" parameterType="long" resultType="long">
        SELECT
            t.station_id
        FROM
            workstation_alone_mapping t
        WHERE
            t.delete_date IS NULL
            AND t.alone_id = #{requireId}
    </select>

    <select id="aloneWorkVO" parameterType="long" resultType="com.laowu.vo.position.AloneWorkVO">
       SELECT
            t2.id,
            t2.workstation_name,
            t.create_date
        FROM
            workstation_alone_mapping t
            LEFT JOIN workstation_dict t2 ON t.alone_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            and t.alone_id = #{id}
    </select>

</mapper>