PositionRequireItemMapper.xml 2.21 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.PositionRequireItemMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.laowu.model.PositionRequireItemDO">
        <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="item_name" property="itemName"/>
        <result column="company_id" property="companyId"/>
        <result column="job_id" property="jobId"/>
    </resultMap>

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

    <select id="requirements" resultType="com.laowu.vo.position.RequirementsVO">
        SELECT
        distinct t.id,
        t.company_id,
        t.item_status,
        t2.company_name,
        t.province,
        t.city,
        t.county,
        t.item_name,
        t.job_id,
        t3.position_status
        FROM
        position_require_item t
        LEFT JOIN company_dict t2 ON t.company_id = t2.id
        LEFT JOIN position_item_info t3 ON t.id = t3.position_require_id
        WHERE
        t.delete_date IS NULL
        AND t2.delete_date IS NULL
        and t3.delete_date is null
        and t.origin_id is null
        <if test="itemName != null and itemName != ''">
            and t.item_name like concat('%', #{itemName}, '%')
        </if>
        <if test="itemStatus != null and itemStatus != ''">
            and t.item_status = #{itemStatus}
        </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="positionId != null and positionId != ''">
            and t3.position_id = #{positionId}
        </if>
    </select>

</mapper>