|
@@ -8,23 +8,21 @@
|
|
|
<id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
|
|
|
<result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
|
|
|
<result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
|
|
|
- <result property="content" column="content" javaType="String" jdbcType="VARCHAR"/>
|
|
|
- <result property="table_name" column="table_name" javaType="String" jdbcType="VARCHAR"/>
|
|
|
- <result property="foreigns" column="foreigns" javaType="String" jdbcType="VARCHAR"/>
|
|
|
+ <result property="html" column="html" javaType="String" jdbcType="VARCHAR"/>
|
|
|
+ <result property="config" column="config" javaType="String" jdbcType="VARCHAR"/>
|
|
|
+ <result property="meta" column="meta" javaType="String" jdbcType="VARCHAR"/>
|
|
|
<result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
|
|
|
- <result property="auto_alter" column="auto_alter" javaType="boolean" jdbcType="INTEGER"/>
|
|
|
<result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
|
|
|
<result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
|
|
|
- <result property="db_name" column="db_name" javaType="String" jdbcType="VARCHAR"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!--字段信息绑定-->
|
|
|
<sql id="fieldConfig">
|
|
|
- <bind name="$fieldsType"
|
|
|
- value="#{'u_id':'string','name':'string','content':'string','table_name':'string'
|
|
|
- ,'foreigns':'string','remark':'string','auto_alter':'string','create_date':'string'
|
|
|
- ,'update_date':'string','db_name':'string'}"/>
|
|
|
- <bind name="$fields" value="$fieldsType.keySet()"/>
|
|
|
+ <bind name="$fieldsInfo"
|
|
|
+ value="#{'u_id':'string','name':'string','html':'string','meta':'string'
|
|
|
+ ,'config':'string','remark':'string','create_date':'string'
|
|
|
+ ,'update_date':'string'}"/>
|
|
|
+ <bind name="$fields" value="$fieldsInfo.keySet()"/>
|
|
|
</sql>
|
|
|
<!--表名-->
|
|
|
<sql id="tableName">
|
|
@@ -33,9 +31,9 @@
|
|
|
|
|
|
<insert id="insert" parameterType="Form" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
|
|
|
INSERT INTO S_FORM
|
|
|
- (u_id,name,content,table_name,foreigns,remark,auto_alter,create_date,update_date,db_name)
|
|
|
+ (u_id,name,html,meta,config,remark,create_date,update_date)
|
|
|
VALUES
|
|
|
- (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{table_name,jdbcType=VARCHAR},#{foreigns,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{auto_alter,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP},#{db_name,jdbcType=VARCHAR})
|
|
|
+ (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{html,jdbcType=VARCHAR},#{meta,jdbcType=VARCHAR},#{config,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
|
|
|
|
<delete id="delete" parameterType="Form">
|
|
@@ -48,27 +46,21 @@
|
|
|
<if test="name != null">
|
|
|
name=#{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="content != null">
|
|
|
- content=#{content,jdbcType=VARCHAR},
|
|
|
+ <if test="html != null">
|
|
|
+ html=#{html,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="table_name != null">
|
|
|
- table_name=#{table_name,jdbcType=VARCHAR},
|
|
|
+ <if test="meta != null">
|
|
|
+ meta=#{meta,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="foreigns != null">
|
|
|
- foreigns=#{foreigns,jdbcType=VARCHAR},
|
|
|
+ <if test="config != null">
|
|
|
+ config=#{config,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="remark != null">
|
|
|
remark=#{remark,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="auto_alter != null">
|
|
|
- auto_alter=#{auto_alter,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
<if test="update_date != null">
|
|
|
update_date=#{update_date,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="db_name != null">
|
|
|
- db_name=#{db_name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
</set>
|
|
|
WHERE u_id=#{u_id}
|
|
|
</update>
|
|
@@ -80,12 +72,12 @@
|
|
|
<select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="FormResultMap">
|
|
|
<include refid="fieldConfig"/>
|
|
|
<include refid="tableName"/>
|
|
|
- <include refid="BasicMapper.selectSql"/>
|
|
|
+ <include refid="BasicMapper.buildSelectSql"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
|
|
|
<include refid="fieldConfig"/>
|
|
|
<include refid="tableName"/>
|
|
|
- <include refid="BasicMapper.totalSql"/>
|
|
|
+ <include refid="BasicMapper.buildTotalSql"/>
|
|
|
</select>
|
|
|
</mapper>
|