| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?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.ruoyi.interfaces.mapper.SysMetaFieldMapper">
- <resultMap type="com.ruoyi.interfaces.domain.SysMetaField" id="SysMetaFieldResult">
- <result property="dsCode" column="DS_CODE" />
- <result property="metaTable" column="META_TABLE" />
- <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" />
- </resultMap>
- <sql id="selectSysMetaFieldVo">
- select DS_CODE, META_TABLE, 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 sys_meta_field
- </sql>
- <select id="selectSysMetaFieldList" parameterType="com.ruoyi.interfaces.domain.SysMetaField" resultMap="SysMetaFieldResult">
- <include refid="selectSysMetaFieldVo"/>
- <where>
- <if test="dsCode != null and dsCode != ''"> and DS_CODE = #{dsCode}</if>
- <if test="metaTable != null and metaTable != ''"> and META_TABLE = #{metaTable}</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>
- </where>
- order by FIELD_ORDER
- </select>
- <select id="selectSysMetaFieldByDsCode" parameterType="String" resultMap="SysMetaFieldResult">
- <include refid="selectSysMetaFieldVo"/>
- where DS_CODE = #{dsCode}
- </select>
- <insert id="insertSysMetaField" parameterType="com.ruoyi.interfaces.domain.SysMetaField">
- insert into sys_meta_field
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="dsCode != null">DS_CODE,</if>
- <if test="metaTable != null">META_TABLE,</if>
- <if test="fieldCode != null">FIELD_CODE,</if>
- <if test="fieldName != null">FIELD_NAME,</if>
- <if test="fieldType != null">FIELD_TYPE,</if>
- <if test="fieldLength != null">FIELD_LENGTH,</if>
- <if test="fieldPrecision != null">FIELD_PRECISION,</if>
- <if test="fieldIspri != null">FIELD_ISPRI,</if>
- <if test="fieldIsnullable != null">FIELD_ISNULLABLE,</if>
- <if test="fieldDefault != null">FIELD_DEFAULT,</if>
- <if test="fieldDesc != null">FIELD_DESC,</if>
- <if test="fieldStatus != null">FIELD_STATUS,</if>
- <if test="fieldOrder != null">FIELD_ORDER,</if>
- <if test="fieldExtend != null">FIELD_EXTEND,</if>
- <if test="fieldExtendTable != null">FIELD_EXTEND_TABLE,</if>
- <if test="fieldInputType != null">FIELD_INPUT_TYPE,</if>
- <if test="fieldInputFormat != null">FIELD_INPUT_FORMAT,</if>
- <if test="fieldInputDefault != null">FIELD_INPUT_DEFAULT,</if>
- <if test="fieldViewType != null">FIELD_VIEW_TYPE,</if>
- <if test="fieldDict != null">FIELD_DICT,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="dsCode != null">#{dsCode},</if>
- <if test="metaTable != null">#{metaTable},</if>
- <if test="fieldCode != null">#{fieldCode},</if>
- <if test="fieldName != null">#{fieldName},</if>
- <if test="fieldType != null">#{fieldType},</if>
- <if test="fieldLength != null">#{fieldLength},</if>
- <if test="fieldPrecision != null">#{fieldPrecision},</if>
- <if test="fieldIspri != null">#{fieldIspri},</if>
- <if test="fieldIsnullable != null">#{fieldIsnullable},</if>
- <if test="fieldDefault != null">#{fieldDefault},</if>
- <if test="fieldDesc != null">#{fieldDesc},</if>
- <if test="fieldStatus != null">#{fieldStatus},</if>
- <if test="fieldOrder != null">#{fieldOrder},</if>
- <if test="fieldExtend != null">#{fieldExtend},</if>
- <if test="fieldExtendTable != null">#{fieldExtendTable},</if>
- <if test="fieldInputType != null">#{fieldInputType},</if>
- <if test="fieldInputFormat != null">#{fieldInputFormat},</if>
- <if test="fieldInputDefault != null">#{fieldInputDefault},</if>
- <if test="fieldViewType != null">#{fieldViewType},</if>
- <if test="fieldDict != null">#{fieldDict},</if>
- </trim>
- </insert>
- <update id="updateSysMetaField" parameterType="com.ruoyi.interfaces.domain.SysMetaField">
- update sys_meta_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},
- </trim>
- where DS_CODE = #{dsCode}
- and META_TABLE = #{metaTable}
- and FIELD_CODE = #{fieldCode}
- </update>
- <delete id="deleteSysMetaField" parameterType="String">
- delete
- from sys_meta_field
- where DS_CODE = #{dsCode}
- and META_TABLE = #{metaTable}
- and FIELD_CODE = #{fieldCode}
- </delete>
- <delete id="deleteSysMetaFieldAll">
- delete
- from sys_meta_field
- where DS_CODE = #{dsCode}
- and META_TABLE = #{metaTable}
- </delete>
- </mapper>
|