package com.persagy.server.labsl.services.mappers

import com.persagy.server.labsl.models.entities.auxiliary.CategoryCode
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select
import org.springframework.stereotype.Repository

/**
 * 自定义SQL
 *
 * @author  wx
 * @date  2020/9/17 12:01
 */
@Repository
@Mapper
interface CustomMapper {
    /** 未发布 */
    @Select("SELECT category_id as categoryId FROM labsl.graph  WHERE project_id = #{projectId} GROUP BY category_id")
    fun calcAffected(@Param("projectId") projectId: String) : ArrayList<CategoryCode>?

    /** 已发布 */
    @Select("SELECT category_id as categoryId FROM labsl.graph_pub  WHERE project_id = #{projectId} GROUP BY category_id")
    fun pubCategory(@Param("projectId") projectId: String) : ArrayList<CategoryCode>?

} // Interface CustomMapper