<?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.muchinfo.mtp3interface.mapper.IEnumdicMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.muchinfo.mtp3pojos.entity.Enumdic">
        <id column="AUTOID" property="autoid" />
        <result column="ENUMGROUPID" property="enumgroupid" />
        <result column="ENUMDICCODE" property="enumdiccode" />
        <result column="ENUMDICNAME" property="enumdicname" />
        <result column="ITEMSTATUS" property="itemstatus" />
        <result column="ISMAPPINGTOBANK" property="ismappingtobank" />
        <result column="REMARK" property="remark" />
        <result column="SHOWFLAG" property="showflag" />
        <result column="MODIFYFLAG" property="modifyflag" />
        <result column="ITEMMAINTAINTYPE" property="itemmaintaintype" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        AUTOID, ENUMGROUPID, ENUMDICCODE, ENUMDICNAME, ITEMSTATUS, ISMAPPINGTOBANK, REMARK, SHOWFLAG, MODIFYFLAG, ITEMMAINTAINTYPE
    </sql>
    <select id="queryEnumDicByPage" resultType="com.muchinfo.mtp3pojos.vo.systemsetup.EnumDicsPageResult">
        select * from EnumDic
        <where>
            <if test="vo.enumgroupid != null">
                and enumgroupid = #{vo.enumgroupid}
            </if>
            <if test="vo.enumdiccode != null">
                and enumdiccode = #{vo.enumdiccode}
            </if>
            <if test="vo.showflag != null">
                and showflag = #{vo.showflag}
            </if>
            <if test="vo.modifyflag != null">
                and modifyflag = #{vo.modifyflag}
            </if>
        </where>
        order by autoid
    </select>
    <select id="queryEnumDicItemByPage" resultType="com.muchinfo.mtp3pojos.vo.systemsetup.EnumDicsPageResult">
        select * from EnumDicItem edi LEFT JOIN EnumDic ed ON ed.AUTOID = edi.ENUMDICID
        <where>
            <if test="vo.enumdiccode != null">
                and edi.enumdiccode = #{vo.enumdiccode}
            </if>
            <if test="vo.enumitemstatus != null">
                and edi.enumitemstatus = #{vo.enumitemstatus}
            </if>
        </where>
        order by edi.autoid
    </select>

</mapper>
