Blame view

WorkstationAloneMappingMapper.xml 3.55 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?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
涂亚平 committed
48 49 50 51 52
        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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
        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>