MdDataFieldMapper.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.MdDataFieldMapper">
  6. <resultMap type="com.ruoyi.interfaces.domain.MdDataField" id="MdDataFieldResult">
  7. <result property="dcCode" column="DC_CODE" />
  8. <result property="fieldCode" column="FIELD_CODE" />
  9. <result property="fieldName" column="FIELD_NAME" />
  10. <result property="fieldType" column="FIELD_TYPE" />
  11. <result property="fieldLength" column="FIELD_LENGTH" />
  12. <result property="fieldPrecision" column="FIELD_PRECISION" />
  13. <result property="fieldIspri" column="FIELD_ISPRI" />
  14. <result property="fieldIsnullable" column="FIELD_ISNULLABLE" />
  15. <result property="fieldDefault" column="FIELD_DEFAULT" />
  16. <result property="fieldDesc" column="FIELD_DESC" />
  17. <result property="fieldStatus" column="FIELD_STATUS" />
  18. <result property="fieldOrder" column="FIELD_ORDER" />
  19. <result property="fieldExtend" column="FIELD_EXTEND" />
  20. <result property="fieldExtendTable" column="FIELD_EXTEND_TABLE" />
  21. <result property="fieldInputType" column="FIELD_INPUT_TYPE" />
  22. <result property="fieldInputFormat" column="FIELD_INPUT_FORMAT" />
  23. <result property="fieldInputDefault" column="FIELD_INPUT_DEFAULT" />
  24. <result property="fieldViewType" column="FIELD_VIEW_TYPE" />
  25. <result property="fieldDict" column="FIELD_DICT" />
  26. </resultMap>
  27. <sql id="selectMdDataFieldVo">
  28. 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
  29. </sql>
  30. <select id="selectMdDataFieldList" parameterType="com.ruoyi.interfaces.domain.MdDataField" resultMap="MdDataFieldResult">
  31. <include refid="selectMdDataFieldVo"/>
  32. <where>
  33. <if test="dcCode != null and dcCode != ''"> and DC_CODE = #{dcCode}</if>
  34. <if test="fieldName != null and fieldName != ''"> and FIELD_NAME like concat('%', #{fieldName}, '%')</if>
  35. <if test="fieldType != null and fieldType != ''"> and FIELD_TYPE = #{fieldType}</if>
  36. <if test="fieldLength != null and fieldLength != ''"> and FIELD_LENGTH = #{fieldLength}</if>
  37. <if test="fieldPrecision != null and fieldPrecision != ''"> and FIELD_PRECISION = #{fieldPrecision}</if>
  38. <if test="fieldIspri != null and fieldIspri != ''"> and FIELD_ISPRI = #{fieldIspri}</if>
  39. <if test="fieldIsnullable != null and fieldIsnullable != ''"> and FIELD_ISNULLABLE = #{fieldIsnullable}</if>
  40. <if test="fieldDefault != null and fieldDefault != ''"> and FIELD_DEFAULT = #{fieldDefault}</if>
  41. <if test="fieldDesc != null and fieldDesc != ''"> and FIELD_DESC = #{fieldDesc}</if>
  42. <if test="fieldStatus != null and fieldStatus != ''"> and FIELD_STATUS = #{fieldStatus}</if>
  43. <if test="fieldOrder != null "> and FIELD_ORDER = #{fieldOrder}</if>
  44. <if test="fieldExtend != null and fieldExtend != ''"> and FIELD_EXTEND = #{fieldExtend}</if>
  45. <if test="fieldExtendTable != null and fieldExtendTable != ''"> and FIELD_EXTEND_TABLE = #{fieldExtendTable}</if>
  46. <if test="fieldInputType != null and fieldInputType != ''"> and FIELD_INPUT_TYPE = #{fieldInputType}</if>
  47. <if test="fieldInputFormat != null and fieldInputFormat != ''"> and FIELD_INPUT_FORMAT = #{fieldInputFormat}</if>
  48. <if test="fieldInputDefault != null and fieldInputDefault != ''"> and FIELD_INPUT_DEFAULT = #{fieldInputDefault}</if>
  49. <if test="fieldViewType != null and fieldViewType != ''"> and FIELD_VIEW_TYPE = #{fieldViewType}</if>
  50. <if test="fieldDict != null and fieldDict != ''"> and FIELD_DICT = #{fieldDict}</if>
  51. </where>
  52. order by FIELD_ORDER
  53. </select>
  54. <select id="selectMdDataFieldByDsCode" parameterType="String" resultMap="MdDataFieldResult">
  55. <include refid="selectMdDataFieldVo"/>
  56. where DC_CODE = #{dcCode}
  57. </select>
  58. <insert id="insertMdDataField" parameterType="com.ruoyi.interfaces.domain.MdDataField">
  59. insert into md_data_field
  60. <trim prefix="(" suffix=")" suffixOverrides=",">
  61. <if test="dcCode != null">DC_CODE,</if>
  62. <if test="fieldCode != null">FIELD_CODE,</if>
  63. <if test="fieldName != null">FIELD_NAME,</if>
  64. <if test="fieldType != null">FIELD_TYPE,</if>
  65. <if test="fieldLength != null">FIELD_LENGTH,</if>
  66. <if test="fieldPrecision != null">FIELD_PRECISION,</if>
  67. <if test="fieldIspri != null">FIELD_ISPRI,</if>
  68. <if test="fieldIsnullable != null">FIELD_ISNULLABLE,</if>
  69. <if test="fieldDefault != null">FIELD_DEFAULT,</if>
  70. <if test="fieldDesc != null">FIELD_DESC,</if>
  71. <if test="fieldStatus != null">FIELD_STATUS,</if>
  72. <if test="fieldOrder != null">FIELD_ORDER,</if>
  73. <if test="fieldExtend != null">FIELD_EXTEND,</if>
  74. <if test="fieldExtendTable != null">FIELD_EXTEND_TABLE,</if>
  75. <if test="fieldInputType != null">FIELD_INPUT_TYPE,</if>
  76. <if test="fieldInputFormat != null">FIELD_INPUT_FORMAT,</if>
  77. <if test="fieldInputDefault != null">FIELD_INPUT_DEFAULT,</if>
  78. <if test="fieldViewType != null">FIELD_VIEW_TYPE,</if>
  79. <if test="fieldDict != null">FIELD_DICT,</if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides=",">
  82. <if test="dcCode != null">#{dcCode},</if>
  83. <if test="fieldCode != null">#{fieldCode},</if>
  84. <if test="fieldName != null">#{fieldName},</if>
  85. <if test="fieldType != null">#{fieldType},</if>
  86. <if test="fieldLength != null">#{fieldLength},</if>
  87. <if test="fieldPrecision != null">#{fieldPrecision},</if>
  88. <if test="fieldIspri != null">#{fieldIspri},</if>
  89. <if test="fieldIsnullable != null">#{fieldIsnullable},</if>
  90. <if test="fieldDefault != null">#{fieldDefault},</if>
  91. <if test="fieldDesc != null">#{fieldDesc},</if>
  92. <if test="fieldStatus != null">#{fieldStatus},</if>
  93. <if test="fieldOrder != null">#{fieldOrder},</if>
  94. <if test="fieldExtend != null">#{fieldExtend},</if>
  95. <if test="fieldExtendTable != null">#{fieldExtendTable},</if>
  96. <if test="fieldInputType != null">#{fieldInputType},</if>
  97. <if test="fieldInputFormat != null">#{fieldInputFormat},</if>
  98. <if test="fieldInputDefault != null">#{fieldInputDefault},</if>
  99. <if test="fieldViewType != null">#{fieldViewType},</if>
  100. <if test="fieldDict != null">#{fieldDict},</if>
  101. </trim>
  102. </insert>
  103. <update id="updateMdDataField" parameterType="com.ruoyi.interfaces.domain.MdDataField">
  104. update md_data_field
  105. <trim prefix="SET" suffixOverrides=",">
  106. FIELD_NAME = #{fieldName,jdbcType=VARCHAR},
  107. FIELD_TYPE = #{fieldType,jdbcType=VARCHAR},
  108. FIELD_LENGTH = #{fieldLength,jdbcType=VARCHAR},
  109. FIELD_PRECISION = #{fieldPrecision,jdbcType=VARCHAR},
  110. FIELD_ISPRI = #{fieldIspri,jdbcType=VARCHAR},
  111. FIELD_ISNULLABLE = #{fieldIsnullable,jdbcType=VARCHAR},
  112. FIELD_DEFAULT = #{fieldDefault,jdbcType=VARCHAR},
  113. FIELD_DESC = #{fieldDesc,jdbcType=VARCHAR},
  114. FIELD_STATUS = #{fieldStatus,jdbcType=VARCHAR},
  115. FIELD_ORDER = #{fieldOrder,jdbcType=INTEGER},
  116. FIELD_EXTEND = #{fieldExtend,jdbcType=VARCHAR},
  117. FIELD_EXTEND_TABLE = #{fieldExtendTable,jdbcType=VARCHAR},
  118. FIELD_INPUT_TYPE = #{fieldInputType,jdbcType=VARCHAR},
  119. FIELD_INPUT_FORMAT = #{fieldInputFormat,jdbcType=VARCHAR},
  120. FIELD_INPUT_DEFAULT = #{fieldInputDefault,jdbcType=VARCHAR},
  121. FIELD_VIEW_TYPE = #{fieldViewType,jdbcType=VARCHAR},
  122. FIELD_DICT = #{fieldDict,jdbcType=VARCHAR},
  123. </trim>
  124. where DC_CODE = #{dcCode} and
  125. FIELD_CODE = #{fieldCode}
  126. </update>
  127. <delete id="deleteMdDataFieldByDsCode" parameterType="String">
  128. delete from md_data_field where DC_CODE = #{dcCode}
  129. </delete>
  130. <delete id="deleteMdDataFieldByDsCodes" parameterType="String">
  131. delete from md_data_field where DC_CODE in
  132. <foreach item="dcCode" collection="array" open="(" separator="," close=")">
  133. #{dcCode}
  134. </foreach>
  135. </delete>
  136. <delete id="deleteMdDataFieldOne">
  137. delete
  138. from md_data_field
  139. where DC_CODE = #{dcCode}
  140. and field_Code = #{fieldCode}
  141. </delete>
  142. </mapper>