| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- <?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 table_field
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from table_field
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TableField" useGeneratedKeys="true" keyProperty="id">
- insert into 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 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 table_field
- <where>
- and del_flag = 'N'
- <if test="record.id != null and !"".equals(record.id)">
- and id = #{record.id}
- </if>
- <if test="record.name != null and !"".equals(record.name)">
- and name = #{record.name}
- </if>
- <if test="record.remark != null and !"".equals(record.remark)">
- and remark = #{record.remark}
- </if>
- <if test="record.jdbcType != null and !"".equals(record.jdbcType)">
- and jdbcType = #{record.jdbcType}
- </if>
- <if test="record.javaType != null and !"".equals(record.javaType)">
- and javaType = #{record.javaType}
- </if>
- <if test="record.length != null and !"".equals(record.length)">
- and length = #{record.length}
- </if>
- <if test="record.decimalPlaces != null and !"".equals(record.decimalPlaces)">
- and decimalPlaces = #{record.decimalPlaces}
- </if>
- <if test="record.defaultValue != null and !"".equals(record.defaultValue)">
- and defaultValue = #{record.defaultValue}
- </if>
- <if test="record.notNull != null and !"".equals(record.notNull)">
- and notNull = #{record.notNull}
- </if>
- <if test="record.primaryKey != null and !"".equals(record.primaryKey)">
- and primaryKey = #{record.primaryKey}
- </if>
- <if test="record.autoIncrease != null and !"".equals(record.autoIncrease)">
- and autoIncrease = #{record.autoIncrease}
- </if>
- <if test="record.showInList != null and !"".equals(record.showInList)">
- and showInList = #{record.showInList}
- </if>
- <if test="record.showInForm != null and !"".equals(record.showInForm)">
- and showInForm = #{record.showInForm}
- </if>
- <if test="record.searchable != null and !"".equals(record.searchable)">
- and searchable = #{record.searchable}
- </if>
- <if test="record.formType != null and !"".equals(record.formType)">
- and formType = #{record.formType}
- </if>
- <if test="record.searchMethod != null and !"".equals(record.searchMethod)">
- and searchMethod = #{record.searchMethod}
- </if>
- <if test="record.required != null and !"".equals(record.required)">
- and required = #{record.required}
- </if>
- <if test="record.validate != null and !"".equals(record.validate)">
- and validate = #{record.validate}
- </if>
- <if test="record.minLength != null and !"".equals(record.minLength)">
- and minLength = #{record.minLength}
- </if>
- <if test="record.maxLength != null and !"".equals(record.maxLength)">
- and maxLength = #{record.maxLength}
- </if>
- <if test="record.min != null and !"".equals(record.min)">
- and min = #{record.min}
- </if>
- <if test="record.max != null and !"".equals(record.max)">
- and max = #{record.max}
- </if>
- <if test="record.validatorType != null and !"".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 table_field
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="name != null and !"".equals(name)">
- and name = #{name}
- </if>
- <if test="remark != null and !"".equals(remark)">
- and remark = #{remark}
- </if>
- <if test="jdbcType != null and !"".equals(jdbcType)">
- and jdbcType = #{jdbcType}
- </if>
- <if test="javaType != null and !"".equals(javaType)">
- and javaType = #{javaType}
- </if>
- <if test="length != null and !"".equals(length)">
- and length = #{length}
- </if>
- <if test="decimalPlaces != null and !"".equals(decimalPlaces)">
- and decimalPlaces = #{decimalPlaces}
- </if>
- <if test="defaultValue != null and !"".equals(defaultValue)">
- and defaultValue = #{defaultValue}
- </if>
- <if test="notNull != null and !"".equals(notNull)">
- and notNull = #{notNull}
- </if>
- <if test="primaryKey != null and !"".equals(primaryKey)">
- and primaryKey = #{primaryKey}
- </if>
- <if test="autoIncrease != null and !"".equals(autoIncrease)">
- and autoIncrease = #{autoIncrease}
- </if>
- <if test="showInList != null and !"".equals(showInList)">
- and showInList = #{showInList}
- </if>
- <if test="showInForm != null and !"".equals(showInForm)">
- and showInForm = #{showInForm}
- </if>
- <if test="searchable != null and !"".equals(searchable)">
- and searchable = #{searchable}
- </if>
- <if test="formType != null and !"".equals(formType)">
- and formType = #{formType}
- </if>
- <if test="searchMethod != null and !"".equals(searchMethod)">
- and searchMethod = #{searchMethod}
- </if>
- <if test="required != null and !"".equals(required)">
- and required = #{required}
- </if>
- <if test="validate != null and !"".equals(validate)">
- and validate = #{validate}
- </if>
- <if test="minLength != null and !"".equals(minLength)">
- and minLength = #{minLength}
- </if>
- <if test="maxLength != null and !"".equals(maxLength)">
- and maxLength = #{maxLength}
- </if>
- <if test="min != null and !"".equals(min)">
- and min = #{min}
- </if>
- <if test="max != null and !"".equals(max)">
- and max = #{max}
- </if>
- <if test="validatorType != null and !"".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 table_field
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="name != null and !"".equals(name)">
- and name = #{name}
- </if>
- <if test="remark != null and !"".equals(remark)">
- and remark = #{remark}
- </if>
- <if test="jdbcType != null and !"".equals(jdbcType)">
- and jdbcType = #{jdbcType}
- </if>
- <if test="javaType != null and !"".equals(javaType)">
- and javaType = #{javaType}
- </if>
- <if test="length != null and !"".equals(length)">
- and length = #{length}
- </if>
- <if test="decimalPlaces != null and !"".equals(decimalPlaces)">
- and decimalPlaces = #{decimalPlaces}
- </if>
- <if test="defaultValue != null and !"".equals(defaultValue)">
- and defaultValue = #{defaultValue}
- </if>
- <if test="notNull != null and !"".equals(notNull)">
- and notNull = #{notNull}
- </if>
- <if test="primaryKey != null and !"".equals(primaryKey)">
- and primaryKey = #{primaryKey}
- </if>
- <if test="autoIncrease != null and !"".equals(autoIncrease)">
- and autoIncrease = #{autoIncrease}
- </if>
- <if test="showInList != null and !"".equals(showInList)">
- and showInList = #{showInList}
- </if>
- <if test="showInForm != null and !"".equals(showInForm)">
- and showInForm = #{showInForm}
- </if>
- <if test="searchable != null and !"".equals(searchable)">
- and searchable = #{searchable}
- </if>
- <if test="formType != null and !"".equals(formType)">
- and formType = #{formType}
- </if>
- <if test="searchMethod != null and !"".equals(searchMethod)">
- and searchMethod = #{searchMethod}
- </if>
- <if test="required != null and !"".equals(required)">
- and required = #{required}
- </if>
- <if test="validate != null and !"".equals(validate)">
- and validate = #{validate}
- </if>
- <if test="minLength != null and !"".equals(minLength)">
- and minLength = #{minLength}
- </if>
- <if test="maxLength != null and !"".equals(maxLength)">
- and maxLength = #{maxLength}
- </if>
- <if test="min != null and !"".equals(min)">
- and min = #{min}
- </if>
- <if test="max != null and !"".equals(max)">
- and max = #{max}
- </if>
- <if test="validatorType != null and !"".equals(validatorType)">
- and validatorType = #{validatorType}
- </if>
- </where>
- LIMIT 1
- </select>
- <update id="delete">
- UPDATE table_field SET del_flag = 'Y'
- <where>
- AND id = #{id}
- </where>
- </update>
- </mapper>
|