<?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.zjt.mapper.ProductionVarietyDetailMapper">
    <resultMap id="BaseResultMap" type="com.zjt.entity.ProductionVarietyDetail">
        <id column="variety_id" jdbcType="FLOAT" property="varietyId" />
        <result column="variety" jdbcType="VARCHAR" property="variety" />
        <result column="variety_details" jdbcType="VARCHAR" property="varietyDetails" />
        <result column="variety_id" jdbcType="FLOAT" property="varietyId" />
    </resultMap>

    <sql id="Base_Column_List">
        id,variety_id, variety, variety_details
    </sql>
    <select id="selectList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from production_variety_detail
    </select>
    <select id="selectById" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from production_variety_detail
        where variety_id = #{varietyId}
    </select>
    <insert id="insert" parameterType="com.zjt.entity.ProductionVarietyDetail">
    </insert>
    <select id="selectvarietyList" resultMap="BaseResultMap">
        select distinct variety_id,variety
        from production_variety_detail
    </select>
    <select id="selectvarietyDetails" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from production_variety_detail
        where variety = #{variety}
    </select>
</mapper>
