<?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="org.springblade.business.mapper.ImageClassificationShowMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="imageClassificationShowResultMap" type="org.springblade.business.entity.ImageClassificationShow">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="classify_id" property="classifyId"/>
        <result column="project_id" property="projectId"/>
        <result column="contract_id" property="contractId"/>
        <result column="is_show" property="isShow"/>
    </resultMap>

    <select id="queryShowClassify" resultMap="imageClassificationShowResultMap">
        select id,classify_id,is_show from u_image_classification_show where project_id = #{projectId}
        <if test="contractId != null and contractId != ''">
            and contract_id = #{contractId}
        </if>
        <if test="allQuery != null">
            and is_show = 1
        </if>
        and is_deleted = 0;
    </select>

</mapper>
