DragTableStyleMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.system.mapper.DragTableStyleMapper">
  6. <resultMap type="com.ruoyi.system.entity.DragTableStyle" id="DragTableStyleResult">
  7. <result property="id" column="id" />
  8. <result property="styleName" column="style_name" />
  9. <result property="styleCode" column="style_code" />
  10. <result property="tableKey" column="table_key" />
  11. <result property="styleCondtion" column="style_condtion" />
  12. <result property="styleField" column="style_field" />
  13. <result property="styleType" column="style_type" />
  14. <result property="styleDescription" column="style_description" />
  15. <result property="spare1" column="spare1" />
  16. <result property="spare2" column="spare2" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createById" column="create_by_id" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateById" column="update_by_id" />
  23. <result property="updateTime" column="update_time" />
  24. </resultMap>
  25. <sql id="selectDragTableStyleVo">
  26. select id, style_name, style_code, table_key, style_condtion, style_field, style_type, style_description, spare1, spare2, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time from drag_table_style
  27. </sql>
  28. <select id="selectDragTableStyleList" parameterType="com.ruoyi.system.entity.DragTableStyle" resultMap="DragTableStyleResult">
  29. <include refid="selectDragTableStyleVo"/>
  30. where del_flag = '0'
  31. <if test="styleName != null and styleName != ''"> and style_name like concat('%', #{styleName}, '%')</if>
  32. <if test="styleCode != null and styleCode != ''"> and style_code = #{styleCode}</if>
  33. <if test="tableKey != null and tableKey != ''"> and table_key = #{tableKey}</if>
  34. <if test="styleCondtion != null and styleCondtion != ''"> and style_condtion = #{styleCondtion}</if>
  35. <if test="styleField != null and styleField != ''"> and style_field = #{styleField}</if>
  36. <if test="styleType != null "> and style_type = #{styleType}</if>
  37. <if test="styleDescription != null and styleDescription != ''"> and style_description = #{styleDescription}</if>
  38. <if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
  39. <if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
  40. <if test="createById != null "> and create_by_id = #{createById}</if>
  41. <if test="updateById != null "> and update_by_id = #{updateById}</if>
  42. order by create_time desc
  43. </select>
  44. <select id="selectDragTableStyleById" parameterType="Long" resultMap="DragTableStyleResult">
  45. <include refid="selectDragTableStyleVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="batchInsertDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
  49. insert into drag_table_style
  50. (style_name,style_code,table_key,style_condtion,style_field,style_type,style_description,spare1,spare2,create_by,create_by_id,create_time,del_flag)
  51. values
  52. <foreach collection="list" item="item" separator=",">
  53. (#{item.styleName},#{item.styleCode},#{item.tableKey},#{item.styleCondtion},#{item.styleField},#{item.styleType},
  54. #{item.styleDescription},#{item.spare1},#{item.spare2},#{item.createBy},#{item.createById},#{item.createTime},'0')
  55. </foreach>
  56. </insert>
  57. <update id="batchUpdateDragTableStyle" parameterType="com.ruoyi.system.entity.DragTableStyle">
  58. <foreach collection="list" item="item" separator=";">
  59. update drag_table_style
  60. <trim prefix="SET" suffixOverrides=",">
  61. <if test="item.styleName != null">style_name = #{item.styleName},</if>
  62. <if test="item.styleCode != null">style_code = #{item.styleCode},</if>
  63. <if test="item.tableKey != null">table_key = #{item.tableKey},</if>
  64. <if test="item.styleCondtion != null and item.styleCondtion != ''">style_condtion = #{item.styleCondtion},</if>
  65. <if test="item.styleField != null">style_field = #{item.styleField},</if>
  66. <if test="item.styleType != null">style_type = #{item.styleType},</if>
  67. <if test="item.styleDescription != null">style_description = #{item.styleDescription},</if>
  68. <if test="item.spare1 != null">spare1 = #{item.spare1},</if>
  69. <if test="item.spare2 != null">spare2 = #{item.spare2},</if>
  70. <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
  71. <if test="item.updateById != null">update_by_id = #{item.updateById},</if>
  72. <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
  73. </trim>
  74. where id = #{item.id}
  75. </foreach>
  76. </update>
  77. <update id="deleteDragTableStyleByTableKeys" parameterType="String">
  78. update drag_table_style set del_flag = '2' where table_key in
  79. <foreach collection="list" item="tableKey" open="(" close=")" separator=",">
  80. #{tableKey}
  81. </foreach>
  82. </update>
  83. <update id="deleteDragTableStyleByIds">
  84. update drag_table_style set del_flag = '2' where id in
  85. <foreach item="id" collection="list" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </update>
  89. <select id="selectIdByTableKey" resultType="long">
  90. select id from drag_table_style where del_flag = '0' and table_key = #{tableKey}
  91. </select>
  92. </mapper>