<?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.unis.crk.quality.mapper.QualityBaseMapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.crk.quality.entity.QualityBase">
                    <id column="StandardID" property="StandardID" />
                    <result column="IfStarted" property="IfStarted" />
                    <result column="FileName" property="FileName" />
                    <result column="FoodType" property="FoodType" />
                    <result column="FoodName" property="FoodName" />
                    <result column="CreateTime" property="CreateTime" />
                    <result column="Creater" property="Creater" />
                    <result column="Remark" property="Remark" />
                    <result column="is_cpl" property="isCpl" />
                    <result column="UNITID" property="unitid" />
        </resultMap>

    <select id="selectMyMapsPage" resultType="java.util.Map">
        SELECT
        qb.StandardID AS StandardID,
        qb.IfStarted AS IfStarted,
        qb.FileName AS FileName,
        qb.FoodType AS FoodType,
        qb.FoodName AS FoodName,
        qb.CreateTime AS CreateTime,
        qb.Creater AS Creater,
        qb.UNITID AS UNITID,
        b.org_name AS orgName
        FROM
        quality_base AS qb
        LEFT JOIN org_info b ON qb.UNITID = b.org_id
        <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
            where  ${ew.sqlSegment}
        </if>
        ORDER BY	qb.CreateTime DESC
    </select>
</mapper>