<?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="cn.ibizlab.core.sample.mapper.IBIZSample0009Mapper">

    <!--该方法用于重写mybatis中selectById方法，以实现查询逻辑属性-->
	<select id="selectById"  resultMap="IBIZSample0009ResultMap" databaseId="dm">
        <![CDATA[select * from v_ibizsample0009 t1     where  ibizsample0009id=#{id}]]>
    </select>
	<select id="selectById"  resultMap="IBIZSample0009ResultMap" databaseId="hana">
        <![CDATA[select * from v_ibizsample0009 t1     where  ibizsample0009id=#{id}]]>
    </select>
	<select id="selectById"  resultMap="IBIZSample0009ResultMap" databaseId="mysql">
        <![CDATA[select * from v_ibizsample0009 t1     where  ibizsample0009id=#{id}]]>
    </select>
	<select id="selectById"  resultMap="IBIZSample0009ResultMap" databaseId="postgresql">
        <![CDATA[select * from v_ibizsample0009 t1     where  ibizsample0009id=#{id}]]>
    </select>
	<select id="selectById"  resultMap="IBIZSample0009ResultMap" databaseId="sqlserver">
        <![CDATA[select * from v_ibizsample0009 t1     where  ibizsample0009id=#{id}]]>
    </select>

    <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
    <resultMap id="IBIZSample0009ResultMap" type="cn.ibizlab.core.sample.domain.IBIZSample0009" autoMapping="true">
		<id property="ibizsample0009id" column="ibizsample0009id" /><!--主键字段映射-->
            
		
    </resultMap>


    <!--数据集合[Default]-->
	 <select id="searchDefault"  parameterType="cn.ibizlab.core.sample.filter.IBIZSample0009SearchContext"  resultMap="IBIZSample0009ResultMap">
         select t1.* from (
                <include refid="Default" />
         )t1
         <where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
         <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
     </select>

    <!--数据查询[Default]-->
    <sql id="Default" databaseId="dm">
		<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DATE, t1.IBIZSAMPLE0009ID, t1.IBIZSAMPLE0009NAME, t1.KP, t1.PD, t1.PG, t1.SP, t1.SPMC, CONCAT(t1.KP,\";\",t1.PG,\";\",t1.PD,\";\",t1.SP) AS TJ, t1.UPDATEDATE, t1.UPDATEMAN FROM T_IBIZSAMPLE0009 t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="hana">
		<![CDATA[ SELECT t1.\"CREATEDATE\", t1.\"CREATEMAN\", t1.\"DATE\", t1.\"IBIZSAMPLE0009ID\", t1.\"IBIZSAMPLE0009NAME\", t1.\"KP\", t1.\"PD\", t1.\"PG\", t1.\"SP\", t1.\"SPMC\", CONCAT(T1.KP,\";\",T1.PG,\";\",T1.PD,\";\",T1.SP) AS \"TJ\", t1.\"UPDATEDATE\", t1.\"UPDATEMAN\" FROM \"T_IBIZSAMPLE0009\" t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="mysql">
		<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DATE`, t1.`IBIZSAMPLE0009ID`, t1.`IBIZSAMPLE0009NAME`, t1.`KP`, t1.`PD`, t1.`PG`, t1.`SP`, t1.`SPMC`, CONCAT(t1.`KP`,\";\",t1.`PG`,\";\",t1.`PD`,\";\",t1.`SP`) AS `TJ`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_IBIZSAMPLE0009` t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="postgresql">
		<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.DATE, t1.IBIZSAMPLE0009ID, t1.IBIZSAMPLE0009NAME, t1.KP, t1.PD, t1.PG, t1.SP, t1.SPMC, CONCAT(t1.KP,\";\",t1.PG,\";\",t1.PD,\";\",t1.SP) AS TJ, t1.UPDATEDATE, t1.UPDATEMAN FROM T_IBIZSAMPLE0009 t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="sqlserver">
		<![CDATA[ SELECT t1.[CREATEDATE], t1.[CREATEMAN], t1.[DATE], t1.[IBIZSAMPLE0009ID], t1.[IBIZSAMPLE0009NAME], t1.[KP], t1.[PD], t1.[PG], t1.[SP], t1.[SPMC], convert(varchar(50),t1.[KP])+';'+convert(varchar(50),t1.[PG])+';'+convert(varchar(50),t1.[PD])+';'+convert(varchar(50),t1.[SP])+';' AS [TJ], t1.[UPDATEDATE], t1.[UPDATEMAN] FROM [T_IBIZSAMPLE0009] t1  
			]]>
    </sql>
</mapper>

