Blame view

PositionRequireItemMapper.xml 2.28 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
<?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,
35 36 37 38 39
        t3.position_status,
        t.start_date,
        t.end_date,
        t.amount,
        t.address
40 41 42 43 44 45 46 47
        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
48
        and t.origin_id is null
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
        <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>