<?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.dxhy.core.dao.CoreSysGroupConfigDao" >
  <resultMap id="BaseResultMap" type="com.dxhy.api.model.config.sys.SysGroupConfigEntity" >
			 <id column="id" property="id" jdbcType="BIGINT" />
			<result column="company" property="company" jdbcType="VARCHAR" />
			<result column="business_enable" property="businessEnable" jdbcType="VARCHAR" />
			<result column="business_type" property="businessType" jdbcType="VARCHAR" />
			<result column="ocr_type" property="ocrType" jdbcType="VARCHAR" />
			<result column="first_collect_date" property="firstCollectDate" jdbcType="TIMESTAMP" />
			<result column="qs_status" property="qsStatus" jdbcType="VARCHAR" />
			<result column="is_collext" property="isCollext" jdbcType="VARCHAR" />
			<result column="ace_id" property="aceId" jdbcType="VARCHAR" />
			<result column="ace_key" property="aceKey" jdbcType="VARCHAR" />
			<result column="db_name" property="dbName" jdbcType="VARCHAR" />
		    <result column="data_ace_id" property="dataAceId" jdbcType="VARCHAR" />
		    <result column="data_ace_key" property="dataAceKey" jdbcType="VARCHAR" />
			<result column="pzxz" property="pzxz" jdbcType="VARCHAR" />
			<result column="czr_mc" property="czrMc" jdbcType="VARCHAR" />
			<result column="czr_id" property="czrId" jdbcType="VARCHAR" />
			<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
			<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
		id,
		company,
		business_enable,
		business_type,
		ocr_type,
		first_collect_date,
		qs_status,
		is_collext,
		ace_id,
		ace_key,
		db_name,
		data_ace_id,
		data_ace_key,
		pzxz,
		czr_mc,
		czr_id,
		create_time,
		update_time
  </sql>
	<select id="getApplyKeyByNsrsbh" resultType="java.util.Map">
		SELECT DISTINCT qy.nsrsbh taxno,
						qy.nsrmc taxname,
						config.db_name,
						qy.company,
						config.ace_id aceId,
						config.ace_key aceKey,
						config.data_ace_id dataAceId,
						config.data_ace_key dataAceKey
		FROM
			sys_group_config config
				JOIN sys_enterprise_config qy ON config.company = qy.company
		where qy.nsrsbh = #{nsrsbh}
	</select>

</mapper>