MdDataSetMapper.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.MdDataSetMapper">
  6. <resultMap type="com.ruoyi.interfaces.domain.MdDataSet" id="MdDataSetResult">
  7. <result property="dcCode" column="DC_CODE" />
  8. <result property="cateId" column="CATE_ID" />
  9. <result property="dcName" column="DC_NAME" />
  10. <result property="dcType" column="DC_TYPE" />
  11. <result property="dcSort" column="DC_SORT" />
  12. <result property="dcIcon" column="DC_ICON" />
  13. <result property="dcNote" column="DC_NOTE" />
  14. </resultMap>
  15. <sql id="selectMdDataSetVo">
  16. select DC_CODE, CATE_ID, DC_NAME, DC_TYPE, DC_SORT, DC_ICON, DC_NOTE from md_data_set
  17. </sql>
  18. <select id="selectMdDataSetList" parameterType="com.ruoyi.interfaces.domain.MdDataSet" resultMap="MdDataSetResult">
  19. <include refid="selectMdDataSetVo"/>
  20. <where>
  21. <if test="dcCode != null and dcCode != ''">and DC_CODE = #{dcCode}</if>
  22. <if test="cateId != null and cateId != ''">and CATE_ID = #{cateId}</if>
  23. <if test="dcName != null and dcName != ''">and DC_NAME like concat('%', #{dcName}, '%')</if>
  24. <if test="dcType != null and dcType != ''">and DC_TYPE = #{dcType}</if>
  25. <if test="dcSort != null ">and DC_SORT = #{dcSort}</if>
  26. <if test="dcIcon != null and dcIcon != ''">and DC_ICON = #{dcIcon}</if>
  27. <if test="dcNote != null and dcNote != ''">and DC_NOTE = #{dcNote}</if>
  28. <if test="params.notInMdid != null ">and DC_CODE NOT in (
  29. select DC_CODE FROM md_model_set_rela WHERE MDID = #{params.notInMdid}
  30. )
  31. </if>
  32. <if test="params.inMdid != null ">and DC_CODE in (
  33. select DC_CODE FROM md_model_set_rela WHERE MDID = #{params.inMdid}
  34. )
  35. </if>
  36. </where>
  37. order by DC_SORT
  38. </select>
  39. <select id="selectMdDataSetByDsCode" parameterType="String" resultMap="MdDataSetResult">
  40. <include refid="selectMdDataSetVo"/>
  41. where DC_CODE = #{dcCode}
  42. </select>
  43. <insert id="insertMdDataSet" parameterType="com.ruoyi.interfaces.domain.MdDataSet">
  44. insert into md_data_set
  45. <trim prefix="(" suffix=")" suffixOverrides=",">
  46. <if test="dcCode != null">DC_CODE,</if>
  47. <if test="cateId != null">CATE_ID,</if>
  48. <if test="dcName != null">DC_NAME,</if>
  49. <if test="dcType != null">DC_TYPE,</if>
  50. <if test="dcSort != null">DC_SORT,</if>
  51. <if test="dcIcon != null">DC_ICON,</if>
  52. <if test="dcNote != null">DC_NOTE,</if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="dcCode != null">#{dcCode},</if>
  56. <if test="cateId != null">#{cateId},</if>
  57. <if test="dcName != null">#{dcName},</if>
  58. <if test="dcType != null">#{dcType},</if>
  59. <if test="dcSort != null">#{dcSort},</if>
  60. <if test="dcIcon != null">#{dcIcon},</if>
  61. <if test="dcNote != null">#{dcNote},</if>
  62. </trim>
  63. </insert>
  64. <update id="updateMdDataSet" parameterType="com.ruoyi.interfaces.domain.MdDataSet">
  65. update md_data_set
  66. <trim prefix="SET" suffixOverrides=",">
  67. CATE_ID = #{cateId,jdbcType=VARCHAR},
  68. DC_NAME = #{dcName,jdbcType=VARCHAR},
  69. DC_TYPE = #{dcType,jdbcType=VARCHAR},
  70. DC_SORT = #{dcSort,jdbcType=INTEGER},
  71. DC_ICON = #{dcIcon,jdbcType=VARCHAR},
  72. DC_NOTE = #{dcNote,jdbcType=VARCHAR},
  73. </trim>
  74. where DC_CODE = #{dcCode}
  75. </update>
  76. <delete id="deleteMdDataSetByDsCode" parameterType="String">
  77. delete from md_data_set where DC_CODE = #{dcCode}
  78. </delete>
  79. <delete id="deleteMdDataSetByDsCodes" parameterType="String">
  80. delete from md_data_set where DC_CODE in
  81. <foreach item="dcCode" collection="array" open="(" separator="," close=")">
  82. #{dcCode}
  83. </foreach>
  84. </delete>
  85. </mapper>