<?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.finishedGrainSupervision.modular.mapper.DataCrkywCplrkFlt001Mapper">

        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.unis.finishedGrainSupervision.modular.entity.DataCrkywCplrkFlt001">
                    <id column="dataId" property="dataId" />
                    <result column="mainDataId" property="mainDataId" />
                    <result column="unitid" property="unitid" />
                    <result column="builder" property="builder" />
                    <result column="cjsj" property="cjsj" />
                    <result column="editor" property="editor" />
                    <result column="modifyDate" property="modifyDate" />
                    <result column="updateTime" property="updateTime" />
                    <result column="scrq" property="scrq" />
                    <result column="bzq" property="bzq" />
                    <result column="xz" property="xz" />
                    <result column="deptId" property="deptId" />
                    <result column="sjjlpzmc" property="sjjlpzmc" />
                    <result column="sjjlpzbh" property="sjjlpzbh" />
                    <result column="sjjlppmc" property="sjjlppmc" />
                    <result column="sjjlppbh" property="sjjlppbh" />
                    <result column="sjjldjbh" property="sjjldjbh" />
                    <result column="sjjldjmc" property="sjjldjmc" />
                    <result column="sjjlspmc" property="sjjlspmc" />
                    <result column="sjjlspmcbh" property="sjjlspmcbh" />
                    <result column="scpc" property="scpc" />
                     <result column="zjbh" property="zjbh" />
                    <result column="gg" property="gg" />
                    <result column="jldw" property="jldw" />
                    <result column="js" property="js" />
                    <result column="dj" property="dj" />
                    <result column="je" property="je" />
                    <result column="sjjlsl" property="sjjlsl" />
                    <result column="ddcbid" property="ddcbid" />
                    <result column="cd" property="cd" />
                    <result column="scnf" property="scnf" />
                    <result column="bz" property="bz" />
                    <result column="syurl" property="syurl" />
                    <result column="istax" property="istax" />
                    <result column="taxrate" property="taxrate" />
        </resultMap>
    <select id="selectRkdetails"
            resultType="com.unis.finishedGrainSupervision.modular.entity.DataCrkywCplrkFlt001">
        SELECT
            sjjlspmc,
            sjjlppmc,
            xz.enumname as "grainNatureName",
            cf_enum.storehouse_name cfname,
            hw_enum.warehouse_name hwname,
            bpgp.quantity,
            sjjldjbh,
            js,
            gg,
            sjjlsl,
            dj,
            je,
            scrq
        FROM
            depot_qh.data_crkyw_cplrk_flt_001 rk
                LEFT JOIN depot_qh.business_pg_gops_plan_detail bpgp ON rk.ddcbid = bpgp.id
                LEFT JOIN depot_qh.basic_storehouse cf_enum ON cf_enum.storehouse_id = rk.ch
                LEFT JOIN depot_qh.basic_warehouse hw_enum ON hw_enum.warehouse_id = rk.hwh
            LEFT JOIN depot_qh.basic_enum xz ON xz.enumId = rk.xz

        where rk.mainDataId=#{dateCrkywCplcrkIdParam.dataId}
    </select>

</mapper>