formfieldDAO.xml 2.58 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
			</if>
12 13 14
			<if test="IS_SHOW_LIST != null and IS_SHOW_LIST != ''">
				and f.IS_SHOW_LIST = #{IS_SHOW_LIST}
			</if>
罗绍泽 committed
15 16 17
			<if test="DELETE_FLAG != null and DELETE_FLAG != ''">
				and f.DELETE_FLAG = #{DELETE_FLAG}
			</if>
陈玉兰 committed
18 19
		</trim>
	</sql>
陈玉兰 committed
20 21
	<insert id="insert_form_field" parameterType="map">
		insert into C_T_FORM_FIELD(
陈玉兰 committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35
		<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
36
	<update id="update_form_field" parameterType="map">
陈玉兰 committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
	       <![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
52
	<delete id="delete_form_field" parameterType="list">
陈玉兰 committed
53
        <![CDATA[
陈玉兰 committed
54
           update  C_T_FORM_FIELD set DELETE_FLAG=1 where UUID IN
陈玉兰 committed
55 56 57 58 59 60 61
         ]]>
		<foreach collection="list" item="UUID" open="(" separator=","
			close=")">
			#{UUID}
		</foreach>
	</delete>

陈玉兰 committed
62 63
	<delete id="delete_form_field_byTableid" parameterType="list">
        <![CDATA[
陈玉兰 committed
64
            update C_T_FORM_FIELD set DELETE_FLAG=1 where TABLE_ID IN
陈玉兰 committed
65 66 67 68 69 70 71
         ]]>
		<foreach collection="list" item="UUID" open="(" separator=","
			close=")">
			#{UUID}
		</foreach>
	</delete>
	<select id="list_form_field" parameterType="map" resultType="upperCaseKeyMap">
陈玉兰 committed
72 73
	 <![CDATA[
	  select f.* 
罗绍泽 committed
74
	  from C_T_FORM_FIELD f
陈玉兰 committed
75 76 77 78
     ]]>
		<include refid="Where_Clause" />
		order by f.CREATE_TIME DESC
	</select>
陈玉兰 committed
79 80 81 82 83 84 85 86 87 88
	
	<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
89 90
		resultType="int">
	 <![CDATA[
陈玉兰 committed
91
	   select count(*) c from C_T_FORM_FIELD f 
陈玉兰 committed
92 93 94 95 96
     ]]>
		<include refid="Where_Clause" />
	</select>

</mapper>