formfieldDAO.xml 2.35 KB
Newer Older
陈玉兰 committed
1 2 3 4 5 6 7 8
<?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.gaowj.business.formfield.formfieldDAO">
	<sql id="Where_Clause">
		<trim prefix="WHERE" prefixOverrides="AND |OR">
			<if test="UUID != null and UUID != ''">
				and f.UUID = #{UUID}
			</if>
陈玉兰 committed
9 10
			<if test="TABLE_ID != null and TABLE_ID != ''">
				and f.TABLE_ID = #{TABLE_ID}
陈玉兰 committed
11 12 13
			</if>
		</trim>
	</sql>
陈玉兰 committed
14 15
	<insert id="insert_form_field" parameterType="map">
		insert into C_T_FORM_FIELD(
陈玉兰 committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29
		<trim prefix="" suffixOverrides=",">
			<foreach collection="infoListKey" item="key">
				${key},
			</foreach>
		</trim>
	      <![CDATA[ ) values( ]]>
		<trim prefix="" suffixOverrides=",">
			<foreach collection="infoList" item="value">
				#{value},
			</foreach>
		</trim>
	      <![CDATA[ ) ]]>
	</insert>

陈玉兰 committed
30
	<update id="update_form_field" parameterType="map">
陈玉兰 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
	       <![CDATA[
            update C_T_FORM_FIELD set 
         ]]>
		<trim prefix="" suffixOverrides=",">
			<foreach collection="info" item="info">
				${info.key} = #{info.value} ,
			</foreach>
		</trim>
		<where>
			<if test="UUID != null and UUID != ''">
				and UUID = #{UUID}
			</if>
		</where>
	</update>

陈玉兰 committed
46
	<delete id="delete_form_field" parameterType="list">
陈玉兰 committed
47 48 49 50 51 52 53 54 55
        <![CDATA[
            delete from  C_T_FORM_FIELD where UUID IN
         ]]>
		<foreach collection="list" item="UUID" open="(" separator=","
			close=")">
			#{UUID}
		</foreach>
	</delete>

陈玉兰 committed
56 57 58 59 60 61 62 63 64 65
	<delete id="delete_form_field_byTableid" parameterType="list">
        <![CDATA[
            delete from  C_T_FORM_FIELD where TABLE_ID IN
         ]]>
		<foreach collection="list" item="UUID" open="(" separator=","
			close=")">
			#{UUID}
		</foreach>
	</delete>
	<select id="list_form_field" parameterType="map" resultType="upperCaseKeyMap">
陈玉兰 committed
66 67 68 69 70 71 72
	 <![CDATA[
	  select f.* 
	  from C_T_FORM_FIELD f
     ]]>
		<include refid="Where_Clause" />
		order by f.CREATE_TIME DESC
	</select>
陈玉兰 committed
73 74 75 76 77 78 79 80 81 82
	
	<select id="list_form_field_byTableid" parameterType="string" resultType="upperCaseKeyMap">
	 <![CDATA[
	  select f.* 
	  from C_T_FORM_FIELD f where f.TABLE_ID =#{TABLE_ID}
     ]]>
		order by f.ORDER_NUM ASC
	</select>
	
	<select id="listCount_form_field" parameterType="map"
陈玉兰 committed
83 84
		resultType="int">
	 <![CDATA[
陈玉兰 committed
85
	   select count(*) c from C_T_FORM_FIELD f 
陈玉兰 committed
86 87 88 89 90
     ]]>
		<include refid="Where_Clause" />
	</select>

</mapper>