瀏覽代碼

字典管理sql修改

Wang Zi Wen 2 年之前
父節點
當前提交
ca118a4d48

+ 7 - 2
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where dict_code = #{dictCode}
 	</update>
@@ -94,7 +94,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</update>
  	
  	<insert id="insertDictData" parameterType="SysDictData">
+		<selectKey keyProperty="dictCode" resultType="long" order="BEFORE">
+			SELECT SEQ_SYS_DICT_DATA.NEXTVAL as dictCode FROM DUAL
+		</selectKey>
  		insert into sys_dict_data(
+ 			<if test="dictCode != null">dict_code,</if>
  			<if test="dictSort != null">dict_sort,</if>
  			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
  			<if test="dictValue != null and dictValue != ''">dict_value,</if>
@@ -107,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			create_time
  		)values(
+ 		    <if test="dictCode != null">#{dictCode},</if>
  		    <if test="dictSort != null">#{dictSort},</if>
  		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
  			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
@@ -117,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			sysdate
  		)
 	</insert>
 	

+ 7 - 2
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -79,13 +79,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate
  		</set>
  		where dict_id = #{dictId}
 	</update>
  	
  	<insert id="insertDictType" parameterType="SysDictType">
+		<selectKey keyProperty="dictId" resultType="long" order="BEFORE">
+			SELECT SEQ_SYS_DICT_TYPE.NEXTVAL as dictId FROM DUAL
+		</selectKey>
  		insert into sys_dict_type(
+ 			<if test="dictId != null and dictId != ''">dict_id,</if>
  			<if test="dictName != null and dictName != ''">dict_name,</if>
  			<if test="dictType != null and dictType != ''">dict_type,</if>
  			<if test="status != null">status,</if>
@@ -93,12 +97,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			create_time
  		)values(
+		<if test="dictId != null and dictId != ''">#{dictId},</if>
  			<if test="dictName != null and dictName != ''">#{dictName},</if>
  			<if test="dictType != null and dictType != ''">#{dictType},</if>
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			sysdate
  		)
 	</insert>