<?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.nantian.cloud.jljc.mapper.DictEnterpriseTypeMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.nantian.cloud.jljc.entity.DictEnterpriseType">
        <id column="id" property="id" />
        <result column="name_samr" property="nameSamr" />
        <result column="code1998" property="code1998" />
        <result column="name1998" property="name1998" />
        <result column="version" property="version" />
        <result column="userid" property="userid"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="dept_id" property="deptId"/>
    </resultMap>

    <sql id="Base_Column_List">
        id, nameSamr, code1998, name1998, version,  userid, update_time, del_flag, dept_id
    </sql>

    <select id="getTypeByid" resultType="com.nantian.cloud.jljc.entity.DictEnterpriseType">
        select  <include refid="Base_Column_List"></include>
        from dict_enterprise_type
        <if test="id!=null and id!=''">
            where id = #{id}
        </if>
    </select>
    <select id="getTypeByCode1998" resultType="java.lang.String">
        select DISTINCT name1998  from dict_enterprise_type
        <if test="code1998!=null and code1998!=''">
            where code1998 = #{code1998}
        </if>
    </select>

</mapper>
