<?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.izouma.awesomeadmin.dao.TableFieldMapper" >
	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TableField" >
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="name" property="name" jdbcType="VARCHAR" />
		<result column="remark" property="remark" jdbcType="VARCHAR" />
		<result column="jdbcType" property="jdbcType" jdbcType="VARCHAR" />
		<result column="javaType" property="javaType" jdbcType="VARCHAR" />
		<result column="length" property="length" jdbcType="INTEGER" />
		<result column="decimalPlaces" property="decimalPlaces" jdbcType="INTEGER" />
		<result column="defaultValue" property="defaultValue" jdbcType="VARCHAR" />
		<result column="notNull" property="notNull" jdbcType="BIT" />
		<result column="primaryKey" property="primaryKey" jdbcType="BIT" />
		<result column="autoIncrease" property="autoIncrease" jdbcType="BIT" />
		<result column="showInList" property="showInList" jdbcType="BIT" />
		<result column="showInForm" property="showInForm" jdbcType="BIT" />
		<result column="searchable" property="searchable" jdbcType="BIT" />
		<result column="formType" property="formType" jdbcType="VARCHAR" />
		<result column="searchMethod" property="searchMethod" jdbcType="VARCHAR" />
		<result column="required" property="required" jdbcType="BIT" />
		<result column="validate" property="validate" jdbcType="BIT" />
		<result column="minLength" property="minLength" jdbcType="INTEGER" />
		<result column="maxLength" property="maxLength" jdbcType="INTEGER" />
		<result column="min" property="min" jdbcType="VARCHAR" />
		<result column="max" property="max" jdbcType="VARCHAR" />
		<result column="validatorType" property="validatorType" jdbcType="VARCHAR" />
	</resultMap>
	<sql id="Base_Column_List" >
		 id, 'name', remark, jdbcType, javaType, 'length', decimalPlaces, defaultValue, notNull, primaryKey, autoIncrease, showInList, showInForm, searchable, formType, searchMethod, required, validate, minLength, maxLength, 'min','max', validatorType
	</sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
		select
		<include refid="Base_Column_List" />
		from sys_table_field
		where id = #{id,jdbcType=INTEGER}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
		delete from sys_table_field
		where id = #{id,jdbcType=INTEGER}
	</delete>
	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TableField" useGeneratedKeys="true" keyProperty="id">
		insert into sys_table_field
		<trim prefix="(" suffix=")" suffixOverrides="," >
			<if test="id != null" >
				id,	
			</if>
			<if test="name != null" >
				name,	
			</if>
			<if test="remark != null" >
				remark,	
			</if>
			<if test="jdbcType != null" >
				jdbcType,	
			</if>
			<if test="javaType != null" >
				javaType,	
			</if>
			<if test="length != null" >
				length,	
			</if>
			<if test="decimalPlaces != null" >
				decimalPlaces,	
			</if>
			<if test="defaultValue != null" >
				defaultValue,	
			</if>
			<if test="notNull != null" >
				notNull,	
			</if>
			<if test="primaryKey != null" >
				primaryKey,	
			</if>
			<if test="autoIncrease != null" >
				autoIncrease,	
			</if>
			<if test="showInList != null" >
				showInList,	
			</if>
			<if test="showInForm != null" >
				showInForm,	
			</if>
			<if test="searchable != null" >
				searchable,	
			</if>
			<if test="formType != null" >
				formType,	
			</if>
			<if test="searchMethod != null" >
				searchMethod,	
			</if>
			<if test="required != null" >
				required,	
			</if>
			<if test="validate != null" >
				validate,	
			</if>
			<if test="minLength != null" >
				minLength,	
			</if>
			<if test="maxLength != null" >
				maxLength,	
			</if>
			<if test="min != null" >
				min,	
			</if>
			<if test="max != null" >
				max,	
			</if>
			<if test="validatorType != null" >
				validatorType,	
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides="," >
			<if test="id != null" >
				#{id,jdbcType=INTEGER},	
			</if>
			<if test="name != null" >
				#{name,jdbcType=VARCHAR},	
			</if>
			<if test="remark != null" >
				#{remark,jdbcType=VARCHAR},	
			</if>
			<if test="jdbcType != null" >
				#{jdbcType,jdbcType=VARCHAR},	
			</if>
			<if test="javaType != null" >
				#{javaType,jdbcType=VARCHAR},	
			</if>
			<if test="length != null" >
				#{length,jdbcType=INTEGER},	
			</if>
			<if test="decimalPlaces != null" >
				#{decimalPlaces,jdbcType=INTEGER},	
			</if>
			<if test="defaultValue != null" >
				#{defaultValue,jdbcType=VARCHAR},	
			</if>
			<if test="notNull != null" >
				#{notNull,jdbcType=BIT},	
			</if>
			<if test="primaryKey != null" >
				#{primaryKey,jdbcType=BIT},	
			</if>
			<if test="autoIncrease != null" >
				#{autoIncrease,jdbcType=BIT},	
			</if>
			<if test="showInList != null" >
				#{showInList,jdbcType=BIT},	
			</if>
			<if test="showInForm != null" >
				#{showInForm,jdbcType=BIT},	
			</if>
			<if test="searchable != null" >
				#{searchable,jdbcType=BIT},	
			</if>
			<if test="formType != null" >
				#{formType,jdbcType=VARCHAR},	
			</if>
			<if test="searchMethod != null" >
				#{searchMethod,jdbcType=VARCHAR},	
			</if>
			<if test="required != null" >
				#{required,jdbcType=BIT},	
			</if>
			<if test="validate != null" >
				#{validate,jdbcType=BIT},	
			</if>
			<if test="minLength != null" >
				#{minLength,jdbcType=INTEGER},	
			</if>
			<if test="maxLength != null" >
				#{maxLength,jdbcType=INTEGER},	
			</if>
			<if test="min != null" >
				#{min,jdbcType=VARCHAR},	
			</if>
			<if test="max != null" >
				#{max,jdbcType=VARCHAR},	
			</if>
			<if test="validatorType != null" >
				#{validatorType,jdbcType=VARCHAR},	
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TableField" >
		update sys_table_field
		<set >
			<if test="name != null" >
				name = #{name,jdbcType=VARCHAR},	
			</if>
			<if test="remark != null" >
				remark = #{remark,jdbcType=VARCHAR},	
			</if>
			<if test="jdbcType != null" >
				jdbcType = #{jdbcType,jdbcType=VARCHAR},	
			</if>
			<if test="javaType != null" >
				javaType = #{javaType,jdbcType=VARCHAR},	
			</if>
			<if test="length != null" >
				length = #{length,jdbcType=INTEGER},	
			</if>
			<if test="decimalPlaces != null" >
				decimalPlaces = #{decimalPlaces,jdbcType=INTEGER},	
			</if>
			<if test="defaultValue != null" >
				defaultValue = #{defaultValue,jdbcType=VARCHAR},	
			</if>
			<if test="notNull != null" >
				notNull = #{notNull,jdbcType=BIT},	
			</if>
			<if test="primaryKey != null" >
				primaryKey = #{primaryKey,jdbcType=BIT},	
			</if>
			<if test="autoIncrease != null" >
				autoIncrease = #{autoIncrease,jdbcType=BIT},	
			</if>
			<if test="showInList != null" >
				showInList = #{showInList,jdbcType=BIT},	
			</if>
			<if test="showInForm != null" >
				showInForm = #{showInForm,jdbcType=BIT},	
			</if>
			<if test="searchable != null" >
				searchable = #{searchable,jdbcType=BIT},	
			</if>
			<if test="formType != null" >
				formType = #{formType,jdbcType=VARCHAR},	
			</if>
			<if test="searchMethod != null" >
				searchMethod = #{searchMethod,jdbcType=VARCHAR},	
			</if>
			<if test="required != null" >
				required = #{required,jdbcType=BIT},	
			</if>
			<if test="validate != null" >
				validate = #{validate,jdbcType=BIT},	
			</if>
			<if test="minLength != null" >
				minLength = #{minLength,jdbcType=INTEGER},	
			</if>
			<if test="maxLength != null" >
				maxLength = #{maxLength,jdbcType=INTEGER},	
			</if>
			<if test="min != null" >
				min = #{min,jdbcType=VARCHAR},	
			</if>
			<if test="max != null" >
				max = #{max,jdbcType=VARCHAR},	
			</if>
			<if test="validatorType != null" >
				validatorType = #{validatorType,jdbcType=VARCHAR},	
			</if>
		</set>
		where id = #{id,jdbcType=INTEGER}
	</update>
	<select id="queryTableFieldsByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
		select <include refid="Base_Column_List"/> from sys_table_field
		<where>
			and del_flag = 'N'
			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
				and id = #{record.id}	
			</if>
			<if test="record.name != null and !&quot;&quot;.equals(record.name)">
				and name = #{record.name}	
			</if>
			<if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
				and remark = #{record.remark}	
			</if>
			<if test="record.jdbcType != null and !&quot;&quot;.equals(record.jdbcType)">
				and jdbcType = #{record.jdbcType}	
			</if>
			<if test="record.javaType != null and !&quot;&quot;.equals(record.javaType)">
				and javaType = #{record.javaType}	
			</if>
			<if test="record.length != null and !&quot;&quot;.equals(record.length)">
				and length = #{record.length}	
			</if>
			<if test="record.decimalPlaces != null and !&quot;&quot;.equals(record.decimalPlaces)">
				and decimalPlaces = #{record.decimalPlaces}	
			</if>
			<if test="record.defaultValue != null and !&quot;&quot;.equals(record.defaultValue)">
				and defaultValue = #{record.defaultValue}	
			</if>
			<if test="record.notNull != null and !&quot;&quot;.equals(record.notNull)">
				and notNull = #{record.notNull}	
			</if>
			<if test="record.primaryKey != null and !&quot;&quot;.equals(record.primaryKey)">
				and primaryKey = #{record.primaryKey}	
			</if>
			<if test="record.autoIncrease != null and !&quot;&quot;.equals(record.autoIncrease)">
				and autoIncrease = #{record.autoIncrease}	
			</if>
			<if test="record.showInList != null and !&quot;&quot;.equals(record.showInList)">
				and showInList = #{record.showInList}	
			</if>
			<if test="record.showInForm != null and !&quot;&quot;.equals(record.showInForm)">
				and showInForm = #{record.showInForm}	
			</if>
			<if test="record.searchable != null and !&quot;&quot;.equals(record.searchable)">
				and searchable = #{record.searchable}	
			</if>
			<if test="record.formType != null and !&quot;&quot;.equals(record.formType)">
				and formType = #{record.formType}	
			</if>
			<if test="record.searchMethod != null and !&quot;&quot;.equals(record.searchMethod)">
				and searchMethod = #{record.searchMethod}	
			</if>
			<if test="record.required != null and !&quot;&quot;.equals(record.required)">
				and required = #{record.required}	
			</if>
			<if test="record.validate != null and !&quot;&quot;.equals(record.validate)">
				and validate = #{record.validate}	
			</if>
			<if test="record.minLength != null and !&quot;&quot;.equals(record.minLength)">
				and minLength = #{record.minLength}	
			</if>
			<if test="record.maxLength != null and !&quot;&quot;.equals(record.maxLength)">
				and maxLength = #{record.maxLength}	
			</if>
			<if test="record.min != null and !&quot;&quot;.equals(record.min)">
				and min = #{record.min}	
			</if>
			<if test="record.max != null and !&quot;&quot;.equals(record.max)">
				and max = #{record.max}	
			</if>
			<if test="record.validatorType != null and !&quot;&quot;.equals(record.validatorType)">
				and validatorType = #{record.validatorType}	
			</if>
		</where>
		order by id desc
	</select>
	<select id="queryAllTableField" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
		select <include refid="Base_Column_List"/> from sys_table_field
		<where>
			and del_flag = 'N'
			<if test="id != null and !&quot;&quot;.equals(id)">
				and id = #{id}	
			</if>
			<if test="name != null and !&quot;&quot;.equals(name)">
				and name = #{name}	
			</if>
			<if test="remark != null and !&quot;&quot;.equals(remark)">
				and remark = #{remark}	
			</if>
			<if test="jdbcType != null and !&quot;&quot;.equals(jdbcType)">
				and jdbcType = #{jdbcType}	
			</if>
			<if test="javaType != null and !&quot;&quot;.equals(javaType)">
				and javaType = #{javaType}	
			</if>
			<if test="length != null and !&quot;&quot;.equals(length)">
				and length = #{length}	
			</if>
			<if test="decimalPlaces != null and !&quot;&quot;.equals(decimalPlaces)">
				and decimalPlaces = #{decimalPlaces}	
			</if>
			<if test="defaultValue != null and !&quot;&quot;.equals(defaultValue)">
				and defaultValue = #{defaultValue}	
			</if>
			<if test="notNull != null and !&quot;&quot;.equals(notNull)">
				and notNull = #{notNull}	
			</if>
			<if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
				and primaryKey = #{primaryKey}	
			</if>
			<if test="autoIncrease != null and !&quot;&quot;.equals(autoIncrease)">
				and autoIncrease = #{autoIncrease}	
			</if>
			<if test="showInList != null and !&quot;&quot;.equals(showInList)">
				and showInList = #{showInList}	
			</if>
			<if test="showInForm != null and !&quot;&quot;.equals(showInForm)">
				and showInForm = #{showInForm}	
			</if>
			<if test="searchable != null and !&quot;&quot;.equals(searchable)">
				and searchable = #{searchable}	
			</if>
			<if test="formType != null and !&quot;&quot;.equals(formType)">
				and formType = #{formType}	
			</if>
			<if test="searchMethod != null and !&quot;&quot;.equals(searchMethod)">
				and searchMethod = #{searchMethod}	
			</if>
			<if test="required != null and !&quot;&quot;.equals(required)">
				and required = #{required}	
			</if>
			<if test="validate != null and !&quot;&quot;.equals(validate)">
				and validate = #{validate}	
			</if>
			<if test="minLength != null and !&quot;&quot;.equals(minLength)">
				and minLength = #{minLength}	
			</if>
			<if test="maxLength != null and !&quot;&quot;.equals(maxLength)">
				and maxLength = #{maxLength}	
			</if>
			<if test="min != null and !&quot;&quot;.equals(min)">
				and min = #{min}	
			</if>
			<if test="max != null and !&quot;&quot;.equals(max)">
				and max = #{max}	
			</if>
			<if test="validatorType != null and !&quot;&quot;.equals(validatorType)">
				and validatorType = #{validatorType}	
			</if>
		</where>
		order by id desc
	</select>
	<select id="queryTableField" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
		select <include refid="Base_Column_List"/> from sys_table_field
		<where>
			and del_flag = 'N'
			<if test="id != null and !&quot;&quot;.equals(id)">
				and id = #{id}	
			</if>
			<if test="name != null and !&quot;&quot;.equals(name)">
				and name = #{name}	
			</if>
			<if test="remark != null and !&quot;&quot;.equals(remark)">
				and remark = #{remark}	
			</if>
			<if test="jdbcType != null and !&quot;&quot;.equals(jdbcType)">
				and jdbcType = #{jdbcType}	
			</if>
			<if test="javaType != null and !&quot;&quot;.equals(javaType)">
				and javaType = #{javaType}	
			</if>
			<if test="length != null and !&quot;&quot;.equals(length)">
				and length = #{length}	
			</if>
			<if test="decimalPlaces != null and !&quot;&quot;.equals(decimalPlaces)">
				and decimalPlaces = #{decimalPlaces}	
			</if>
			<if test="defaultValue != null and !&quot;&quot;.equals(defaultValue)">
				and defaultValue = #{defaultValue}	
			</if>
			<if test="notNull != null and !&quot;&quot;.equals(notNull)">
				and notNull = #{notNull}	
			</if>
			<if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
				and primaryKey = #{primaryKey}	
			</if>
			<if test="autoIncrease != null and !&quot;&quot;.equals(autoIncrease)">
				and autoIncrease = #{autoIncrease}	
			</if>
			<if test="showInList != null and !&quot;&quot;.equals(showInList)">
				and showInList = #{showInList}	
			</if>
			<if test="showInForm != null and !&quot;&quot;.equals(showInForm)">
				and showInForm = #{showInForm}	
			</if>
			<if test="searchable != null and !&quot;&quot;.equals(searchable)">
				and searchable = #{searchable}	
			</if>
			<if test="formType != null and !&quot;&quot;.equals(formType)">
				and formType = #{formType}	
			</if>
			<if test="searchMethod != null and !&quot;&quot;.equals(searchMethod)">
				and searchMethod = #{searchMethod}	
			</if>
			<if test="required != null and !&quot;&quot;.equals(required)">
				and required = #{required}	
			</if>
			<if test="validate != null and !&quot;&quot;.equals(validate)">
				and validate = #{validate}	
			</if>
			<if test="minLength != null and !&quot;&quot;.equals(minLength)">
				and minLength = #{minLength}	
			</if>
			<if test="maxLength != null and !&quot;&quot;.equals(maxLength)">
				and maxLength = #{maxLength}	
			</if>
			<if test="min != null and !&quot;&quot;.equals(min)">
				and min = #{min}	
			</if>
			<if test="max != null and !&quot;&quot;.equals(max)">
				and max = #{max}	
			</if>
			<if test="validatorType != null and !&quot;&quot;.equals(validatorType)">
				and validatorType = #{validatorType}	
			</if>
		</where>
		LIMIT 1
	</select>
	<update id="delete">
		UPDATE sys_table_field SET del_flag = 'Y'
		<where>
			AND id = #{id}
		</where>
	</update>
</mapper>

