package com.zhyc.module.common.mapper;

import com.zhyc.module.common.domain.Post;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PostMapper {

    /**
     * 根据岗位名称模糊查询岗位列表
     *
     * @param postName 岗位名称（可为空）
     * @return 岗位列表
     */
    @Select("SELECT post_id, post_code, post_name, post_sort, status FROM sys_post WHERE  post_name LIKE CONCAT('%', #{postName}, '%') AND status = '0'")
    @Results({
        @Result(property = "postId", column = "post_id"),
        @Result(property = "postCode", column = "post_code"),
        @Result(property = "postName", column = "post_name"),
        @Result(property = "postSort", column = "post_sort"),
        @Result(property = "status", column = "status")
    })
    List<Post> selectPostList(@Param("postName") String postName);
}

