<?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.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl">
	<resultMap id="get-entity-result" type="com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity">
        <!--主键 -->
        <result property="id" column="id" />
	</resultMap>

    <resultMap id="get-DefinitionEntity-result" type="com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity">
        <result property="id" column="id" />
        <result property="name" column="name" />
        <result property="field_info" column="field_info" />
    </resultMap>

	<sql id="Sysproduct_Base_Column_List">
		id as id
	</sql>

	<!-- 修改 -->
	<select id="queryArchives" parameterType="com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity"  resultMap="get-entity-result">
		 select id from  ${tabName}
        <trim prefix="where" prefixOverrides="and">
            <if test="tripartiteId != null and tripartiteId != '' and oaField != null and oaField != '' ">${oaField} = #{tripartiteId} </if>
        </trim>
	</select>



    <!-- 查询模版数据 -->
    <select id="queryDefinitionInfo" parameterType="com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity"  resultMap="get-DefinitionEntity-result">
       SELECT id,NAME,FIELD_INFO from CAP_FORM_DEFINITION
        <trim prefix="where" prefixOverrides="and">
            <if test="formAppId != null and formAppId != ''  "> id = #{formAppId} </if>
        </trim>
    </select>

    <!-- 查询实体数据 -->
    <select id="queryDefinitionData" parameterType="com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity"  resultType="java.util.Map">
        SELECT  *  from ${tabName}
        <trim prefix="where" prefixOverrides="and">
            <if test="formMainId != null and formMainId != '' ">
                and formmain_id = #{formMainId}
            </if>
            <if test="formMainIds != null and formMainIds.size >0 ">
                and id in
                <foreach item="ids" collection="formMainIds" open="(" separator="," close=")">
                    #{ids}
                </foreach>
            </if>
        </trim>
    </select>
</mapper>
