SysMetaFieldMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.interfaces.mapper.SysMetaFieldMapper">
  6. <resultMap type="com.ruoyi.interfaces.domain.SysMetaField" id="SysMetaFieldResult">
  7. <result property="dsCode" column="DS_CODE" />
  8. <result property="metaTable" column="META_TABLE" />
  9. <result property="fieldCode" column="FIELD_CODE" />
  10. <result property="fieldName" column="FIELD_NAME" />
  11. <result property="fieldType" column="FIELD_TYPE" />
  12. <result property="fieldLength" column="FIELD_LENGTH" />
  13. <result property="fieldPrecision" column="FIELD_PRECISION" />
  14. <result property="fieldIspri" column="FIELD_ISPRI" />
  15. <result property="fieldIsnullable" column="FIELD_ISNULLABLE" />
  16. <result property="fieldDefault" column="FIELD_DEFAULT" />
  17. <result property="fieldDesc" column="FIELD_DESC" />
  18. <result property="fieldStatus" column="FIELD_STATUS" />
  19. <result property="fieldOrder" column="FIELD_ORDER" />
  20. <result property="fieldExtend" column="FIELD_EXTEND" />
  21. <result property="fieldExtendTable" column="FIELD_EXTEND_TABLE" />
  22. <result property="fieldInputType" column="FIELD_INPUT_TYPE" />
  23. <result property="fieldInputFormat" column="FIELD_INPUT_FORMAT" />
  24. <result property="fieldInputDefault" column="FIELD_INPUT_DEFAULT" />
  25. <result property="fieldViewType" column="FIELD_VIEW_TYPE" />
  26. <result property="fieldDict" column="FIELD_DICT" />
  27. </resultMap>
  28. <sql id="selectSysMetaFieldVo">
  29. 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
  30. </sql>
  31. <select id="selectSysMetaFieldList" parameterType="com.ruoyi.interfaces.domain.SysMetaField" resultMap="SysMetaFieldResult">
  32. <include refid="selectSysMetaFieldVo"/>
  33. <where>
  34. <if test="dsCode != null and dsCode != ''"> and DS_CODE = #{dsCode}</if>
  35. <if test="metaTable != null and metaTable != ''"> and META_TABLE = #{metaTable}</if>
  36. <if test="fieldCode != null and fieldCode != ''"> and FIELD_CODE = #{fieldCode}</if>
  37. <if test="fieldName != null and fieldName != ''"> and FIELD_NAME like concat('%', #{fieldName}, '%')</if>
  38. <if test="fieldType != null and fieldType != ''"> and FIELD_TYPE = #{fieldType}</if>
  39. <if test="fieldLength != null and fieldLength != ''"> and FIELD_LENGTH = #{fieldLength}</if>
  40. <if test="fieldPrecision != null and fieldPrecision != ''"> and FIELD_PRECISION = #{fieldPrecision}</if>
  41. <if test="fieldIspri != null and fieldIspri != ''"> and FIELD_ISPRI = #{fieldIspri}</if>
  42. <if test="fieldIsnullable != null and fieldIsnullable != ''"> and FIELD_ISNULLABLE = #{fieldIsnullable}</if>
  43. <if test="fieldDefault != null and fieldDefault != ''"> and FIELD_DEFAULT = #{fieldDefault}</if>
  44. <if test="fieldDesc != null and fieldDesc != ''"> and FIELD_DESC = #{fieldDesc}</if>
  45. <if test="fieldStatus != null and fieldStatus != ''"> and FIELD_STATUS = #{fieldStatus}</if>
  46. <if test="fieldOrder != null "> and FIELD_ORDER = #{fieldOrder}</if>
  47. <if test="fieldExtend != null and fieldExtend != ''"> and FIELD_EXTEND = #{fieldExtend}</if>
  48. <if test="fieldExtendTable != null and fieldExtendTable != ''"> and FIELD_EXTEND_TABLE = #{fieldExtendTable}</if>
  49. <if test="fieldInputType != null and fieldInputType != ''"> and FIELD_INPUT_TYPE = #{fieldInputType}</if>
  50. <if test="fieldInputFormat != null and fieldInputFormat != ''"> and FIELD_INPUT_FORMAT = #{fieldInputFormat}</if>
  51. <if test="fieldInputDefault != null and fieldInputDefault != ''"> and FIELD_INPUT_DEFAULT = #{fieldInputDefault}</if>
  52. <if test="fieldViewType != null and fieldViewType != ''"> and FIELD_VIEW_TYPE = #{fieldViewType}</if>
  53. <if test="fieldDict != null and fieldDict != ''"> and FIELD_DICT = #{fieldDict}</if>
  54. </where>
  55. order by FIELD_ORDER
  56. </select>
  57. <select id="selectSysMetaFieldByDsCode" parameterType="String" resultMap="SysMetaFieldResult">
  58. <include refid="selectSysMetaFieldVo"/>
  59. where DS_CODE = #{dsCode}
  60. </select>
  61. <insert id="insertSysMetaField" parameterType="com.ruoyi.interfaces.domain.SysMetaField">
  62. insert into sys_meta_field
  63. <trim prefix="(" suffix=")" suffixOverrides=",">
  64. <if test="dsCode != null">DS_CODE,</if>
  65. <if test="metaTable != null">META_TABLE,</if>
  66. <if test="fieldCode != null">FIELD_CODE,</if>
  67. <if test="fieldName != null">FIELD_NAME,</if>
  68. <if test="fieldType != null">FIELD_TYPE,</if>
  69. <if test="fieldLength != null">FIELD_LENGTH,</if>
  70. <if test="fieldPrecision != null">FIELD_PRECISION,</if>
  71. <if test="fieldIspri != null">FIELD_ISPRI,</if>
  72. <if test="fieldIsnullable != null">FIELD_ISNULLABLE,</if>
  73. <if test="fieldDefault != null">FIELD_DEFAULT,</if>
  74. <if test="fieldDesc != null">FIELD_DESC,</if>
  75. <if test="fieldStatus != null">FIELD_STATUS,</if>
  76. <if test="fieldOrder != null">FIELD_ORDER,</if>
  77. <if test="fieldExtend != null">FIELD_EXTEND,</if>
  78. <if test="fieldExtendTable != null">FIELD_EXTEND_TABLE,</if>
  79. <if test="fieldInputType != null">FIELD_INPUT_TYPE,</if>
  80. <if test="fieldInputFormat != null">FIELD_INPUT_FORMAT,</if>
  81. <if test="fieldInputDefault != null">FIELD_INPUT_DEFAULT,</if>
  82. <if test="fieldViewType != null">FIELD_VIEW_TYPE,</if>
  83. <if test="fieldDict != null">FIELD_DICT,</if>
  84. </trim>
  85. <trim prefix="values (" suffix=")" suffixOverrides=",">
  86. <if test="dsCode != null">#{dsCode},</if>
  87. <if test="metaTable != null">#{metaTable},</if>
  88. <if test="fieldCode != null">#{fieldCode},</if>
  89. <if test="fieldName != null">#{fieldName},</if>
  90. <if test="fieldType != null">#{fieldType},</if>
  91. <if test="fieldLength != null">#{fieldLength},</if>
  92. <if test="fieldPrecision != null">#{fieldPrecision},</if>
  93. <if test="fieldIspri != null">#{fieldIspri},</if>
  94. <if test="fieldIsnullable != null">#{fieldIsnullable},</if>
  95. <if test="fieldDefault != null">#{fieldDefault},</if>
  96. <if test="fieldDesc != null">#{fieldDesc},</if>
  97. <if test="fieldStatus != null">#{fieldStatus},</if>
  98. <if test="fieldOrder != null">#{fieldOrder},</if>
  99. <if test="fieldExtend != null">#{fieldExtend},</if>
  100. <if test="fieldExtendTable != null">#{fieldExtendTable},</if>
  101. <if test="fieldInputType != null">#{fieldInputType},</if>
  102. <if test="fieldInputFormat != null">#{fieldInputFormat},</if>
  103. <if test="fieldInputDefault != null">#{fieldInputDefault},</if>
  104. <if test="fieldViewType != null">#{fieldViewType},</if>
  105. <if test="fieldDict != null">#{fieldDict},</if>
  106. </trim>
  107. </insert>
  108. <update id="updateSysMetaField" parameterType="com.ruoyi.interfaces.domain.SysMetaField">
  109. update sys_meta_field
  110. <trim prefix="SET" suffixOverrides=",">
  111. FIELD_NAME = #{fieldName,jdbcType=VARCHAR},
  112. FIELD_TYPE = #{fieldType,jdbcType=VARCHAR},
  113. FIELD_LENGTH = #{fieldLength,jdbcType=VARCHAR},
  114. FIELD_PRECISION = #{fieldPrecision,jdbcType=VARCHAR},
  115. FIELD_ISPRI = #{fieldIspri,jdbcType=VARCHAR},
  116. FIELD_ISNULLABLE = #{fieldIsnullable,jdbcType=VARCHAR},
  117. FIELD_DEFAULT = #{fieldDefault,jdbcType=VARCHAR},
  118. FIELD_DESC = #{fieldDesc,jdbcType=VARCHAR},
  119. FIELD_STATUS = #{fieldStatus,jdbcType=VARCHAR},
  120. FIELD_ORDER = #{fieldOrder,jdbcType=INTEGER},
  121. FIELD_EXTEND = #{fieldExtend,jdbcType=VARCHAR},
  122. FIELD_EXTEND_TABLE = #{fieldExtendTable,jdbcType=VARCHAR},
  123. FIELD_INPUT_TYPE = #{fieldInputType,jdbcType=VARCHAR},
  124. FIELD_INPUT_FORMAT = #{fieldInputFormat,jdbcType=VARCHAR},
  125. FIELD_INPUT_DEFAULT = #{fieldInputDefault,jdbcType=VARCHAR},
  126. FIELD_VIEW_TYPE = #{fieldViewType,jdbcType=VARCHAR},
  127. FIELD_DICT = #{fieldDict,jdbcType=VARCHAR},
  128. </trim>
  129. where DS_CODE = #{dsCode}
  130. and META_TABLE = #{metaTable}
  131. and FIELD_CODE = #{fieldCode}
  132. </update>
  133. <delete id="deleteSysMetaField" parameterType="String">
  134. delete
  135. from sys_meta_field
  136. where DS_CODE = #{dsCode}
  137. and META_TABLE = #{metaTable}
  138. and FIELD_CODE = #{fieldCode}
  139. </delete>
  140. <delete id="deleteSysMetaFieldAll">
  141. delete
  142. from sys_meta_field
  143. where DS_CODE = #{dsCode}
  144. and META_TABLE = #{metaTable}
  145. </delete>
  146. </mapper>