DragTableGroupMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.zkqy.system.mapper.DragTableGroupMapper">
  6. <resultMap type="com.zkqy.system.entity.DragTableGroup" id="DragTableGroupResult">
  7. <result property="id" column="id" />
  8. <result property="groupName" column="group_name" />
  9. <result property="groupDescription" column="group_description" />
  10. <result property="groupTableInfo" column="group_table_info" />
  11. <result property="groupKey" column="group_key" />
  12. <result property="createById" column="create_by_id" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateById" column="update_by_id" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. </resultMap>
  19. <sql id="selectDragTableGroupVo">
  20. select id, group_name, group_description,group_key, group_table_info,create_by_id, create_by, create_time, update_by_id, update_by, update_time from drag_table_group
  21. </sql>
  22. <select id="selectDragTableGroupList" parameterType="com.zkqy.system.entity.DragTableGroup" resultMap="DragTableGroupResult">
  23. <include refid="selectDragTableGroupVo"/>
  24. <where>
  25. <if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
  26. <if test="groupDescription != null and groupDescription != ''"> and group_description = #{groupDescription}</if>
  27. <if test="groupTableInfo != null and groupTableInfo != ''"> and group_table_info = #{groupTableInfo}</if>
  28. <if test="groupType !=null and groupType!=''">and group_type = #{groupType}</if>
  29. <!-- <if test="createById != null and createById != ''" > and create_by_id = #{createById}</if>-->
  30. <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
  31. <!-- <if test="updateById != null and updateById != ''"> and update_by_id = #{updateById}</if>-->
  32. </where>
  33. </select>
  34. <select id="selectDragTableGroupByGroupKey" parameterType="String" resultType="string">
  35. select group_table_info from drag_table_group
  36. where group_key = #{groupKey}
  37. </select>
  38. <select id="selectDragTableGroupById" resultType="com.zkqy.system.entity.DragTableGroup" resultMap="DragTableGroupResult">
  39. <include refid="selectDragTableGroupVo"/>
  40. where id=#{id}
  41. </select>
  42. <select id="selectDragTableGroupByIdIn" resultType="com.zkqy.system.entity.DragTableGroup">
  43. <include refid="selectDragTableGroupVo"/>
  44. where id in
  45. <foreach item="id" collection="array" open="(" separator="," close=")">
  46. #{id}
  47. </foreach>
  48. </select>
  49. <select id="selectDragTableGroupOneByGroupKey" resultType="com.zkqy.system.entity.DragTableGroup" parameterType="string">
  50. <include refid="selectDragTableGroupVo"/>
  51. where group_key=#{groupKey}
  52. </select>
  53. <insert id="insertDragTableGroup" parameterType="com.zkqy.system.entity.DragTableGroup">
  54. insert into drag_table_group
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="id != null">id,</if>
  57. <if test="groupName != null">group_name,</if>
  58. <if test="groupKey!=null">group_key,</if>
  59. <if test="groupType!=null">group_type,</if>
  60. <if test="templateType!=null">template_type,</if>
  61. <if test="groupDescription != null">group_description,</if>
  62. <if test="groupTableInfo != null">group_table_info,</if>
  63. <if test="createById != null">create_by_id,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="createTime != null">create_time,</if>
  66. <if test="updateById != null">update_by_id,</if>
  67. <if test="updateBy != null">update_by,</if>
  68. <if test="updateTime != null">update_time,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="id != null">#{id},</if>
  72. <if test="groupName != null">#{groupName},</if>
  73. <if test="groupKey != null">#{groupKey},</if>
  74. <if test="groupType != null">#{groupType},</if>
  75. <if test="templateType!=null">#{templateType},</if>
  76. <if test="groupDescription != null">#{groupDescription},</if>
  77. <if test="groupTableInfo != null">#{groupTableInfo},</if>
  78. <if test="createById != null">#{createById},</if>
  79. <if test="createBy != null">#{createBy},</if>
  80. <if test="createTime != null">#{createTime},</if>
  81. <if test="updateById != null">#{updateById},</if>
  82. <if test="updateBy != null">#{updateBy},</if>
  83. <if test="updateTime != null">#{updateTime},</if>
  84. </trim>
  85. </insert>
  86. <update id="updateDragTableGroup" parameterType="com.zkqy.system.entity.DragTableGroup">
  87. update drag_table_group
  88. <trim prefix="SET" suffixOverrides=",">
  89. <if test="groupName != null">group_name = #{groupName},</if>
  90. <if test="groupDescription != null">group_description = #{groupDescription},</if>
  91. <if test="groupTableInfo != null">group_table_info = #{groupTableInfo},</if>
  92. <if test="templateType!=null">template_type =#{templateType},</if>
  93. <if test="createById != null">create_by_id = #{createById},</if>
  94. <if test="createBy != null">create_by = #{createBy},</if>
  95. <if test="createTime != null">create_time = #{createTime},</if>
  96. <if test="updateById != null">update_by_id = #{updateById},</if>
  97. <if test="updateBy != null">update_by = #{updateBy},</if>
  98. <if test="updateTime != null">update_time = #{updateTime},</if>
  99. </trim>
  100. where id = #{id}
  101. </update>
  102. <delete id="deleteDragTableGroupById" parameterType="Long">
  103. delete from drag_table_group where id = #{id}
  104. </delete>
  105. <delete id="deleteDragTableGroupByIds" parameterType="String">
  106. delete from drag_table_group where id in
  107. <foreach item="id" collection="array" open="(" separator="," close=")">
  108. #{id}
  109. </foreach>
  110. </delete>
  111. <select id="selectDragTableGroupInfoByGroupKey" resultMap="DragTableGroupResult">
  112. <include refid="selectDragTableGroupVo"/>
  113. where group_key = #{groupKey}
  114. </select>
  115. </mapper>