|
|
@@ -5,68 +5,108 @@
|
|
|
<mapper namespace="com.ruoyi.interfaces.mapper.MdDataFieldMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.interfaces.domain.MdDataField" id="MdDataFieldResult">
|
|
|
- <result property="dcCode" column="DC_CODE" />
|
|
|
- <result property="fieldCode" column="FIELD_CODE" />
|
|
|
- <result property="fieldName" column="FIELD_NAME" />
|
|
|
- <result property="fieldType" column="FIELD_TYPE" />
|
|
|
- <result property="fieldLength" column="FIELD_LENGTH" />
|
|
|
- <result property="fieldPrecision" column="FIELD_PRECISION" />
|
|
|
- <result property="fieldIspri" column="FIELD_ISPRI" />
|
|
|
- <result property="fieldIsnullable" column="FIELD_ISNULLABLE" />
|
|
|
- <result property="fieldDefault" column="FIELD_DEFAULT" />
|
|
|
- <result property="fieldDesc" column="FIELD_DESC" />
|
|
|
- <result property="fieldStatus" column="FIELD_STATUS" />
|
|
|
- <result property="fieldOrder" column="FIELD_ORDER" />
|
|
|
- <result property="fieldExtend" column="FIELD_EXTEND" />
|
|
|
- <result property="fieldExtendTable" column="FIELD_EXTEND_TABLE" />
|
|
|
- <result property="fieldInputType" column="FIELD_INPUT_TYPE" />
|
|
|
- <result property="fieldInputFormat" column="FIELD_INPUT_FORMAT" />
|
|
|
- <result property="fieldInputDefault" column="FIELD_INPUT_DEFAULT" />
|
|
|
- <result property="fieldViewType" column="FIELD_VIEW_TYPE" />
|
|
|
- <result property="fieldDict" column="FIELD_DICT" />
|
|
|
+ <result property="id" column="ID"/>
|
|
|
+ <result property="parentId" column="PARENT_ID"/>
|
|
|
+ <result property="dcCode" column="DC_CODE"/>
|
|
|
+ <result property="fieldCode" column="FIELD_CODE"/>
|
|
|
+ <result property="fieldName" column="FIELD_NAME"/>
|
|
|
+ <result property="fieldType" column="FIELD_TYPE"/>
|
|
|
+ <result property="fieldLength" column="FIELD_LENGTH"/>
|
|
|
+ <result property="fieldPrecision" column="FIELD_PRECISION"/>
|
|
|
+ <result property="fieldIspri" column="FIELD_ISPRI"/>
|
|
|
+ <result property="fieldIsnullable" column="FIELD_ISNULLABLE"/>
|
|
|
+ <result property="fieldDefault" column="FIELD_DEFAULT"/>
|
|
|
+ <result property="fieldDesc" column="FIELD_DESC"/>
|
|
|
+ <result property="fieldStatus" column="FIELD_STATUS"/>
|
|
|
+ <result property="fieldOrder" column="FIELD_ORDER"/>
|
|
|
+ <result property="fieldExtend" column="FIELD_EXTEND"/>
|
|
|
+ <result property="fieldExtendTable" column="FIELD_EXTEND_TABLE"/>
|
|
|
+ <result property="fieldInputType" column="FIELD_INPUT_TYPE"/>
|
|
|
+ <result property="fieldInputFormat" column="FIELD_INPUT_FORMAT"/>
|
|
|
+ <result property="fieldInputDefault" column="FIELD_INPUT_DEFAULT"/>
|
|
|
+ <result property="fieldViewType" column="FIELD_VIEW_TYPE"/>
|
|
|
+ <result property="fieldDict" column="FIELD_DICT"/>
|
|
|
+ <result property="isArray" column="IS_ARRAY"/>
|
|
|
+ <result property="arrayIndex" column="ARRAY_INDEX"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectMdDataFieldVo">
|
|
|
- select DC_CODE, FIELD_CODE, FIELD_NAME, FIELD_TYPE, FIELD_LENGTH, FIELD_PRECISION, FIELD_ISPRI, FIELD_ISNULLABLE, FIELD_DEFAULT, FIELD_DESC, FIELD_STATUS, FIELD_ORDER, FIELD_EXTEND, FIELD_EXTEND_TABLE, FIELD_INPUT_TYPE, FIELD_INPUT_FORMAT, FIELD_INPUT_DEFAULT, FIELD_VIEW_TYPE, FIELD_DICT from md_data_field
|
|
|
+ select ID,
|
|
|
+ PARENT_ID,
|
|
|
+ DC_CODE,
|
|
|
+ FIELD_CODE,
|
|
|
+ FIELD_NAME,
|
|
|
+ FIELD_TYPE,
|
|
|
+ FIELD_LENGTH,
|
|
|
+ FIELD_PRECISION,
|
|
|
+ FIELD_ISPRI,
|
|
|
+ FIELD_ISNULLABLE,
|
|
|
+ FIELD_DEFAULT,
|
|
|
+ FIELD_DESC,
|
|
|
+ FIELD_STATUS,
|
|
|
+ FIELD_ORDER,
|
|
|
+ FIELD_EXTEND,
|
|
|
+ FIELD_EXTEND_TABLE,
|
|
|
+ FIELD_INPUT_TYPE,
|
|
|
+ FIELD_INPUT_FORMAT,
|
|
|
+ FIELD_INPUT_DEFAULT,
|
|
|
+ FIELD_VIEW_TYPE,
|
|
|
+ FIELD_DICT,
|
|
|
+ IS_ARRAY,
|
|
|
+ ARRAY_INDEX
|
|
|
+ from md_data_field
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectMdDataFieldList" parameterType="com.ruoyi.interfaces.domain.MdDataField" resultMap="MdDataFieldResult">
|
|
|
+ <select id="selectMdDataFieldList" parameterType="com.ruoyi.interfaces.domain.MdDataField"
|
|
|
+ resultMap="MdDataFieldResult">
|
|
|
<include refid="selectMdDataFieldVo"/>
|
|
|
<where>
|
|
|
- <if test="dcCode != null and dcCode != ''"> and DC_CODE = #{dcCode}</if>
|
|
|
- <if test="fieldName != null and fieldName != ''"> and FIELD_NAME like concat('%', #{fieldName}, '%')</if>
|
|
|
- <if test="fieldType != null and fieldType != ''"> and FIELD_TYPE = #{fieldType}</if>
|
|
|
- <if test="fieldLength != null and fieldLength != ''"> and FIELD_LENGTH = #{fieldLength}</if>
|
|
|
- <if test="fieldPrecision != null and fieldPrecision != ''"> and FIELD_PRECISION = #{fieldPrecision}</if>
|
|
|
- <if test="fieldIspri != null and fieldIspri != ''"> and FIELD_ISPRI = #{fieldIspri}</if>
|
|
|
- <if test="fieldIsnullable != null and fieldIsnullable != ''"> and FIELD_ISNULLABLE = #{fieldIsnullable}</if>
|
|
|
- <if test="fieldDefault != null and fieldDefault != ''"> and FIELD_DEFAULT = #{fieldDefault}</if>
|
|
|
- <if test="fieldDesc != null and fieldDesc != ''"> and FIELD_DESC = #{fieldDesc}</if>
|
|
|
- <if test="fieldStatus != null and fieldStatus != ''"> and FIELD_STATUS = #{fieldStatus}</if>
|
|
|
- <if test="fieldOrder != null "> and FIELD_ORDER = #{fieldOrder}</if>
|
|
|
- <if test="fieldExtend != null and fieldExtend != ''"> and FIELD_EXTEND = #{fieldExtend}</if>
|
|
|
- <if test="fieldExtendTable != null and fieldExtendTable != ''"> and FIELD_EXTEND_TABLE = #{fieldExtendTable}</if>
|
|
|
- <if test="fieldInputType != null and fieldInputType != ''"> and FIELD_INPUT_TYPE = #{fieldInputType}</if>
|
|
|
- <if test="fieldInputFormat != null and fieldInputFormat != ''"> and FIELD_INPUT_FORMAT = #{fieldInputFormat}</if>
|
|
|
- <if test="fieldInputDefault != null and fieldInputDefault != ''"> and FIELD_INPUT_DEFAULT = #{fieldInputDefault}</if>
|
|
|
- <if test="fieldViewType != null and fieldViewType != ''"> and FIELD_VIEW_TYPE = #{fieldViewType}</if>
|
|
|
- <if test="fieldDict != null and fieldDict != ''"> and FIELD_DICT = #{fieldDict}</if>
|
|
|
+ <if test="id != null ">and ID = #{id}</if>
|
|
|
+ <if test="parentId != null ">and PARENT_ID = #{parentId}</if>
|
|
|
+ <if test="dcCode != null and dcCode != ''">and DC_CODE = #{dcCode}</if>
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">and FIELD_CODE = #{fieldCode}</if>
|
|
|
+ <if test="fieldName != null and fieldName != ''">and FIELD_NAME like concat('%', #{fieldName}, '%')</if>
|
|
|
+ <if test="fieldType != null and fieldType != ''">and FIELD_TYPE = #{fieldType}</if>
|
|
|
+ <if test="fieldLength != null and fieldLength != ''">and FIELD_LENGTH = #{fieldLength}</if>
|
|
|
+ <if test="fieldPrecision != null and fieldPrecision != ''">and FIELD_PRECISION = #{fieldPrecision}</if>
|
|
|
+ <if test="fieldIspri != null and fieldIspri != ''">and FIELD_ISPRI = #{fieldIspri}</if>
|
|
|
+ <if test="fieldIsnullable != null and fieldIsnullable != ''">and FIELD_ISNULLABLE = #{fieldIsnullable}</if>
|
|
|
+ <if test="fieldDefault != null and fieldDefault != ''">and FIELD_DEFAULT = #{fieldDefault}</if>
|
|
|
+ <if test="fieldDesc != null and fieldDesc != ''">and FIELD_DESC = #{fieldDesc}</if>
|
|
|
+ <if test="fieldStatus != null and fieldStatus != ''">and FIELD_STATUS = #{fieldStatus}</if>
|
|
|
+ <if test="fieldOrder != null ">and FIELD_ORDER = #{fieldOrder}</if>
|
|
|
+ <if test="fieldExtend != null and fieldExtend != ''">and FIELD_EXTEND = #{fieldExtend}</if>
|
|
|
+ <if test="fieldExtendTable != null and fieldExtendTable != ''">and FIELD_EXTEND_TABLE =
|
|
|
+ #{fieldExtendTable}
|
|
|
+ </if>
|
|
|
+ <if test="fieldInputType != null and fieldInputType != ''">and FIELD_INPUT_TYPE = #{fieldInputType}</if>
|
|
|
+ <if test="fieldInputFormat != null and fieldInputFormat != ''">and FIELD_INPUT_FORMAT =
|
|
|
+ #{fieldInputFormat}
|
|
|
+ </if>
|
|
|
+ <if test="fieldInputDefault != null and fieldInputDefault != ''">and FIELD_INPUT_DEFAULT =
|
|
|
+ #{fieldInputDefault}
|
|
|
+ </if>
|
|
|
+ <if test="fieldViewType != null and fieldViewType != ''">and FIELD_VIEW_TYPE = #{fieldViewType}</if>
|
|
|
+ <if test="fieldDict != null and fieldDict != ''">and FIELD_DICT = #{fieldDict}</if>
|
|
|
+ <if test="isArray != null and isArray != ''">and IS_ARRAY = #{isArray}</if>
|
|
|
+ <if test="arrayIndex != null and arrayIndex != ''">and ARRAY_INDEX = #{arrayIndex}</if>
|
|
|
</where>
|
|
|
- order by FIELD_ORDER
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectMdDataFieldByDsCode" parameterType="String" resultMap="MdDataFieldResult">
|
|
|
+ <select id="selectMdDataFieldById" parameterType="Long" resultMap="MdDataFieldResult">
|
|
|
<include refid="selectMdDataFieldVo"/>
|
|
|
- where DC_CODE = #{dcCode}
|
|
|
+ where ID = #{id}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertMdDataField" parameterType="com.ruoyi.interfaces.domain.MdDataField">
|
|
|
insert into md_data_field
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">ID,</if>
|
|
|
+ <if test="parentId != null">PARENT_ID,</if>
|
|
|
<if test="dcCode != null">DC_CODE,</if>
|
|
|
- <if test="fieldCode != null">FIELD_CODE,</if>
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">FIELD_CODE,</if>
|
|
|
<if test="fieldName != null">FIELD_NAME,</if>
|
|
|
- <if test="fieldType != null">FIELD_TYPE,</if>
|
|
|
+ <if test="fieldType != null and fieldType != ''">FIELD_TYPE,</if>
|
|
|
<if test="fieldLength != null">FIELD_LENGTH,</if>
|
|
|
<if test="fieldPrecision != null">FIELD_PRECISION,</if>
|
|
|
<if test="fieldIspri != null">FIELD_ISPRI,</if>
|
|
|
@@ -82,12 +122,16 @@
|
|
|
<if test="fieldInputDefault != null">FIELD_INPUT_DEFAULT,</if>
|
|
|
<if test="fieldViewType != null">FIELD_VIEW_TYPE,</if>
|
|
|
<if test="fieldDict != null">FIELD_DICT,</if>
|
|
|
+ <if test="isArray != null">IS_ARRAY,</if>
|
|
|
+ <if test="arrayIndex != null">ARRAY_INDEX,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
<if test="dcCode != null">#{dcCode},</if>
|
|
|
- <if test="fieldCode != null">#{fieldCode},</if>
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">#{fieldCode},</if>
|
|
|
<if test="fieldName != null">#{fieldName},</if>
|
|
|
- <if test="fieldType != null">#{fieldType},</if>
|
|
|
+ <if test="fieldType != null and fieldType != ''">#{fieldType},</if>
|
|
|
<if test="fieldLength != null">#{fieldLength},</if>
|
|
|
<if test="fieldPrecision != null">#{fieldPrecision},</if>
|
|
|
<if test="fieldIspri != null">#{fieldIspri},</if>
|
|
|
@@ -103,48 +147,55 @@
|
|
|
<if test="fieldInputDefault != null">#{fieldInputDefault},</if>
|
|
|
<if test="fieldViewType != null">#{fieldViewType},</if>
|
|
|
<if test="fieldDict != null">#{fieldDict},</if>
|
|
|
+ <if test="isArray != null">#{isArray},</if>
|
|
|
+ <if test="arrayIndex != null">#{arrayIndex},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateMdDataField" parameterType="com.ruoyi.interfaces.domain.MdDataField">
|
|
|
update md_data_field
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- FIELD_NAME = #{fieldName,jdbcType=VARCHAR},
|
|
|
- FIELD_TYPE = #{fieldType,jdbcType=VARCHAR},
|
|
|
- FIELD_LENGTH = #{fieldLength,jdbcType=VARCHAR},
|
|
|
- FIELD_PRECISION = #{fieldPrecision,jdbcType=VARCHAR},
|
|
|
- FIELD_ISPRI = #{fieldIspri,jdbcType=VARCHAR},
|
|
|
- FIELD_ISNULLABLE = #{fieldIsnullable,jdbcType=VARCHAR},
|
|
|
- FIELD_DEFAULT = #{fieldDefault,jdbcType=VARCHAR},
|
|
|
- FIELD_DESC = #{fieldDesc,jdbcType=VARCHAR},
|
|
|
- FIELD_STATUS = #{fieldStatus,jdbcType=VARCHAR},
|
|
|
- FIELD_ORDER = #{fieldOrder,jdbcType=INTEGER},
|
|
|
- FIELD_EXTEND = #{fieldExtend,jdbcType=VARCHAR},
|
|
|
- FIELD_EXTEND_TABLE = #{fieldExtendTable,jdbcType=VARCHAR},
|
|
|
- FIELD_INPUT_TYPE = #{fieldInputType,jdbcType=VARCHAR},
|
|
|
- FIELD_INPUT_FORMAT = #{fieldInputFormat,jdbcType=VARCHAR},
|
|
|
- FIELD_INPUT_DEFAULT = #{fieldInputDefault,jdbcType=VARCHAR},
|
|
|
- FIELD_VIEW_TYPE = #{fieldViewType,jdbcType=VARCHAR},
|
|
|
- FIELD_DICT = #{fieldDict,jdbcType=VARCHAR},
|
|
|
+ <if test="parentId != null">PARENT_ID = #{parentId},</if>
|
|
|
+ <if test="dcCode != null">DC_CODE = #{dcCode},</if>
|
|
|
+ <if test="fieldCode != null and fieldCode != ''">FIELD_CODE = #{fieldCode},</if>
|
|
|
+ <if test="fieldName != null">FIELD_NAME = #{fieldName},</if>
|
|
|
+ <if test="fieldType != null and fieldType != ''">FIELD_TYPE = #{fieldType},</if>
|
|
|
+ <if test="fieldLength != null">FIELD_LENGTH = #{fieldLength},</if>
|
|
|
+ <if test="fieldPrecision != null">FIELD_PRECISION = #{fieldPrecision},</if>
|
|
|
+ <if test="fieldIspri != null">FIELD_ISPRI = #{fieldIspri},</if>
|
|
|
+ <if test="fieldIsnullable != null">FIELD_ISNULLABLE = #{fieldIsnullable},</if>
|
|
|
+ <if test="fieldDefault != null">FIELD_DEFAULT = #{fieldDefault},</if>
|
|
|
+ <if test="fieldDesc != null">FIELD_DESC = #{fieldDesc},</if>
|
|
|
+ <if test="fieldStatus != null">FIELD_STATUS = #{fieldStatus},</if>
|
|
|
+ <if test="fieldOrder != null">FIELD_ORDER = #{fieldOrder},</if>
|
|
|
+ <if test="fieldExtend != null">FIELD_EXTEND = #{fieldExtend},</if>
|
|
|
+ <if test="fieldExtendTable != null">FIELD_EXTEND_TABLE = #{fieldExtendTable},</if>
|
|
|
+ <if test="fieldInputType != null">FIELD_INPUT_TYPE = #{fieldInputType},</if>
|
|
|
+ <if test="fieldInputFormat != null">FIELD_INPUT_FORMAT = #{fieldInputFormat},</if>
|
|
|
+ <if test="fieldInputDefault != null">FIELD_INPUT_DEFAULT = #{fieldInputDefault},</if>
|
|
|
+ <if test="fieldViewType != null">FIELD_VIEW_TYPE = #{fieldViewType},</if>
|
|
|
+ <if test="fieldDict != null">FIELD_DICT = #{fieldDict},</if>
|
|
|
+ <if test="isArray != null">IS_ARRAY = #{isArray},</if>
|
|
|
+ <if test="arrayIndex != null">ARRAY_INDEX = #{arrayIndex},</if>
|
|
|
</trim>
|
|
|
- where DC_CODE = #{dcCode} and
|
|
|
- FIELD_CODE = #{fieldCode}
|
|
|
+ where ID = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <delete id="deleteMdDataFieldByDsCode" parameterType="String">
|
|
|
- delete from md_data_field where DC_CODE = #{dcCode}
|
|
|
+ <delete id="deleteMdDataFieldById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from md_data_field
|
|
|
+ where ID = #{id}
|
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteMdDataFieldByDsCodes" parameterType="String">
|
|
|
- delete from md_data_field where DC_CODE in
|
|
|
- <foreach item="dcCode" collection="array" open="(" separator="," close=")">
|
|
|
- #{dcCode}
|
|
|
+ <delete id="deleteMdDataFieldByIds" parameterType="String">
|
|
|
+ delete from md_data_field where ID in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
- <delete id="deleteMdDataFieldOne">
|
|
|
+ <delete id="deleteMdDataFieldByDcCode">
|
|
|
delete
|
|
|
from md_data_field
|
|
|
where DC_CODE = #{dcCode}
|
|
|
- and field_Code = #{fieldCode}
|
|
|
</delete>
|
|
|
</mapper>
|