<?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.ruoyi.system.mapper.operatingmanage.TPublicServiceComRecruitMapper">

    <resultMap type="com.ruoyi.system.domain.operatingmanage.TPublicServiceComRecruit" id="TPublicServiceComRecruitResult">
        <result property="postId"    column="post_id"    />
        <result property="postName"    column="post_name"    />
        <result property="postType"    column="post_type"    />
        <result property="postEdu"    column="post_edu"    />
        <result property="postExp"    column="post_exp"    />
        <result property="releaseTime"    column="release_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="salary"    column="salary"    />
        <result property="postDesc"    column="post_desc"    />
        <result property="hiddenType"    column="hidden_type"    />
        <result property="comId"    column="com_id"    />
        <result property="valid"    column="valid"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />

        <result property="comName"    column="com_name"    />
    </resultMap>

    <sql id="selectTPublicServiceComRecruitVo">
        select r.post_id, r.post_name, r.post_type, r.post_edu, r.post_exp,
         r.release_time, r.end_time, r.salary, r.post_desc, r.hidden_type,
          r.com_id, r.valid, r.create_time, r.create_by, r.update_time,
           r.update_by, i.com_name
            from t_public_service_com_recruit r
            left join t_public_service_com_info i on r.com_id =i.com_id
    </sql>

    <select id="list" parameterType="com.ruoyi.system.domain.operatingmanage.TPublicServiceComRecruit" resultMap="TPublicServiceComRecruitResult">
        <include refid="selectTPublicServiceComRecruitVo"/>
        <where>
            <if test="postName != null  and postName != ''"> and r.post_name like concat('%', #{postName}, '%')</if>
            <if test="comName != null  and comName != ''"> and i.com_name like concat('%', #{comName}, '%')</if>
            <if test="postType != null  and postType != ''"> and r.post_type = #{postType}</if>
            <if test="postEdu != null  and postEdu != ''"> and r.post_edu = #{postEdu}</if>
            <if test="postExp != null  and postExp != ''"> and r.post_exp = #{postExp}</if>
            <if test="releaseTime != null  and releaseTime != ''"> and r.release_time = #{releaseTime}</if>
            <if test="endTime != null  and endTime != ''"> and r.end_time = #{endTime}</if>
            <if test="salary != null  and salary != ''"> and r.salary = #{salary}</if>
            <if test="postDesc != null  and postDesc != ''"> and r.post_desc = #{postDesc}</if>
            <if test="hiddenType != null "> and r.hidden_type = #{hiddenType}</if>
            <if test="comId != null "> and r.com_id = #{comId}</if>
            <if test="valid != null "> and r.valid = #{valid}</if>
            <if test="createTime != null "> and r.create_time = #{createTime}</if>
            <if test="createBy != null  and createBy != ''"> and r.create_by = #{createBy}</if>
            <if test="updateTime != null "> and r.update_time = #{updateTime}</if>
            <if test="updateBy != null  and updateBy != ''"> and r.update_by = #{updateBy}</if>
            <if test="comIds != null and comIds.size()>0">
                and r.com_id in
                <foreach item="id" collection="comIds" open="(" close=")" separator=",">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>

    <select id="getObjectById" resultMap="TPublicServiceComRecruitResult">
        <include refid="selectTPublicServiceComRecruitVo"/>
        where post_id = #{postId}
    </select>

    <insert id="save" parameterType="com.ruoyi.system.domain.operatingmanage.TPublicServiceComRecruit" useGeneratedKeys="true" keyProperty="postId">
        insert into t_public_service_com_recruit
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="postId != null ">post_id,</if>
            <if test="postName != null  and postName != ''">post_name,</if>
            <if test="postType != null  and postType != ''">post_type,</if>
            <if test="postEdu != null  and postEdu != ''">post_edu,</if>
            <if test="postExp != null  and postExp != ''">post_exp,</if>
            <if test="releaseTime != null  and releaseTime != ''">release_time,</if>
            <if test="endTime != null  and endTime != ''">end_time,</if>
            <if test="salary != null  and salary != ''">salary,</if>
            <if test="postDesc != null  and postDesc != ''">post_desc,</if>
            <if test="hiddenType != null ">hidden_type,</if>
            <if test="comId != null ">com_id,</if>
            <if test="valid != null ">valid,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="updateBy != null  and updateBy != ''">update_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="postId != null ">#{postId},</if>
            <if test="postName != null  and postName != ''">#{postName},</if>
            <if test="postType != null  and postType != ''">#{postType},</if>
            <if test="postEdu != null  and postEdu != ''">#{postEdu},</if>
            <if test="postExp != null  and postExp != ''">#{postExp},</if>
            <if test="releaseTime != null  and releaseTime != ''">#{releaseTime},</if>
            <if test="endTime != null  and endTime != ''">#{endTime},</if>
            <if test="salary != null  and salary != ''">#{salary},</if>
            <if test="postDesc != null  and postDesc != ''">#{postDesc},</if>
            <if test="hiddenType != null ">#{hiddenType},</if>
            <if test="comId != null ">#{comId},</if>
            <if test="valid != null ">#{valid},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
         </trim>
    </insert>

    <update id="update" parameterType="com.ruoyi.system.domain.operatingmanage.TPublicServiceComRecruit">
        update t_public_service_com_recruit
        <trim prefix="SET" suffixOverrides=",">
            <if test="postName != null and postName != ''">post_name = #{postName},</if>
            <if test="postType != null and postType != ''">post_type = #{postType},</if>
            <if test="postEdu != null and postEdu != ''">post_edu = #{postEdu},</if>
            <if test="postExp != null and postExp != ''">post_exp = #{postExp},</if>
            <if test="releaseTime != null and releaseTime != ''">release_time = #{releaseTime},</if>
            <if test="endTime != null and endTime != ''">end_time = #{endTime},</if>
            <if test="salary != null and salary != ''">salary = #{salary},</if>
            <if test="postDesc != null and postDesc != ''">post_desc = #{postDesc},</if>
            <if test="hiddenType != null">hidden_type = #{hiddenType},</if>
            <if test="comId != null">com_id = #{comId},</if>
            <if test="valid != null">valid = #{valid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
        </trim>
        where post_id = #{postId}
    </update>

    <delete id="remove">
        delete from t_public_service_com_recruit
        where post_id = #{postId}
    </delete>

    <delete id="batchRemove">
        delete from t_public_service_com_recruit where
        post_id in
        <foreach item="postId" collection="postId" open="(" separator="," close=")">
            #{postId}
        </foreach>
    </delete>

</mapper>
