<?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.grainReserves.modular.gopsPlanSale.mapper.GopsPlanSaleMapper">
    <select id="selectDetailList" parameterType="com.baomidou.mybatisplus.core.conditions.Wrapper" resultType="com.unis.grainReserves.modular.gopsPlanSale.entity.GopsPlanSale">
        SELECT
            gps.*, be.enumname grainVarietyName,
            be1.enumname grainNatureName,
            be2.enumname grainGradeName
        FROM
            biz_gops_plan_sale gps
        LEFT JOIN depot_qh.basic_enum be ON be.enumId = gps.grain_grade_id
        LEFT JOIN depot_qh.basic_enum be1 ON be1.enumId = gps.grain_nature_id
        LEFT JOIN depot_qh.basic_enum be2 ON be2.enumId = gps.grain_grade_id
        ${ew.customSqlSegment}
    </select>
</mapper>