<?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.IBIZSampleMapper">

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

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


    <!--数据集合[Default]-->
	 <select id="searchDefault"  parameterType="cn.ibizlab.core.sample.filter.IBIZSampleSearchContext"  resultMap="IBIZSampleResultMap">
         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.IBIZSAMPLEID, t1.IBIZSAMPLENAME, t1.LINK1, t1.LINK2, t1.LINK3, t1.LINK4, t1.LINK5, t1.LINK6, t1.OSLINK1, t1.OSLINK2, t1.OSLINK3, t1.OSLINK4, t1.OSLINK5, t1.OSLINK6, t1.SAMPLETYPE, t1.TITLE1, t1.TITLE2, t1.TITLE3, t1.TITLE4, t1.TITLE5, t1.TITLE6, t1.UPDATEDATE, t1.UPDATEMAN FROM T_IBIZSAMPLE t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="hana">
		<![CDATA[ SELECT t1.\"CREATEDATE\", t1.\"CREATEMAN\", t1.\"IBIZSAMPLEID\", t1.\"IBIZSAMPLENAME\", t1.\"LINK1\", t1.\"LINK2\", t1.\"LINK3\", t1.\"LINK4\", t1.\"LINK5\", t1.\"LINK6\", t1.\"SAMPLETYPE\", t1.\"TITLE1\", t1.\"TITLE2\", t1.\"TITLE3\", t1.\"TITLE4\", t1.\"TITLE5\", t1.\"TITLE6\", t1.\"UPDATEDATE\", t1.\"UPDATEMAN\" FROM \"T_IBIZSAMPLE\" t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="mysql">
		<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IBIZSAMPLEID`, t1.`IBIZSAMPLENAME`, t1.`LINK1`, t1.`LINK2`, t1.`LINK3`, t1.`LINK4`, t1.`LINK5`, t1.`LINK6`, t1.`OSLINK1`, t1.`OSLINK2`, t1.`OSLINK3`, t1.`OSLINK4`, t1.`OSLINK5`, t1.`OSLINK6`, t1.`SAMPLETYPE`, t1.`TITLE1`, t1.`TITLE2`, t1.`TITLE3`, t1.`TITLE4`, t1.`TITLE5`, t1.`TITLE6`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_IBIZSAMPLE` t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="postgresql">
		<![CDATA[ SELECT t1.CREATEDATE, t1.CREATEMAN, t1.IBIZSAMPLEID, t1.IBIZSAMPLENAME, t1.LINK1, t1.LINK2, t1.LINK3, t1.LINK4, t1.LINK5, t1.LINK6, t1.OSLINK1, t1.OSLINK2, t1.OSLINK3, t1.OSLINK4, t1.OSLINK5, t1.OSLINK6, t1.SAMPLETYPE, t1.TITLE1, t1.TITLE2, t1.TITLE3, t1.TITLE4, t1.TITLE5, t1.TITLE6, t1.UPDATEDATE, t1.UPDATEMAN FROM T_IBIZSAMPLE t1  
			]]>
    </sql>
    <!--数据查询[Default]-->
    <sql id="Default" databaseId="sqlserver">
		<![CDATA[ SELECT t1.[CREATEDATE], t1.[CREATEMAN], t1.[IBIZSAMPLEID], t1.[IBIZSAMPLENAME], t1.[LINK1], t1.[LINK2], t1.[LINK3], t1.[LINK4], t1.[LINK5], t1.[LINK6], t1.[OSLINK1], t1.[OSLINK2], t1.[OSLINK3], t1.[OSLINK4], t1.[OSLINK5], t1.[OSLINK6], t1.[SAMPLETYPE], t1.[TITLE1], t1.[TITLE2], t1.[TITLE3], t1.[TITLE4], t1.[TITLE5], t1.[TITLE6], t1.[UPDATEDATE], t1.[UPDATEMAN] FROM [T_IBIZSAMPLE] t1  
			]]>
    </sql>
</mapper>

