Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

110 строки
4.2 KiB

  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.iformall.mapper.WxLegionActivityConfigMapper">
  6. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLegionActivityConfig">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
  9. <result property="parentTenantId" column="parent_tenant_id" jdbcType="VARCHAR"/>
  10. <result property="activityId" column="activity_id" jdbcType="BIGINT"/>
  11. <result property="parentId" column="parent_id" jdbcType="BIGINT"/>
  12. <result property="name" column="name" jdbcType="VARCHAR"/>
  13. <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
  14. <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. id,tenant_id,parent_tenant_id,
  18. activity_id,parent_id,`name`,
  19. create_date,update_date
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != tenantId and '' != tenantId">
  27. and `tenant_id` = #{tenantId}
  28. </if>
  29. <if test=" null != parentTenantId and '' != parentTenantId">
  30. and `parent_tenant_id` = #{parentTenantId}
  31. </if>
  32. <if test=" null != activityId ">
  33. and `activity_id` = #{activityId}
  34. </if>
  35. <if test=" null != parentId ">
  36. and `parent_id` = #{parentId}
  37. </if>
  38. <if test=" null != name and name != '' ">
  39. and `name` like concat('%', #{name},'%')
  40. </if>
  41. <if test=" null != ids ">
  42. and id in
  43. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  44. #{idItem}
  45. </foreach>
  46. </if>
  47. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  48. </sql>
  49. <select id="findList" parameterType="com.iformall.domain.po.WxLegionActivityConfig" resultMap="BaseResultMap">
  50. select <include refid="allColumns" /> from wx_legion_activity_config
  51. <include refid="dynamicWhereConditions" />
  52. </select>
  53. <delete id="deleteConfig" parameterType="java.util.HashMap">
  54. delete from wx_legion_activity_config
  55. where `activity_id` = #{activityId}
  56. <if test=" null != tenantId and '' != tenantId">
  57. and `tenant_id` = #{tenantId}
  58. </if>
  59. </delete>
  60. <insert id="insertList" parameterType="java.util.List">
  61. insert into wx_legion_activity_config
  62. (id,
  63. activity_id,parent_id,`name`,
  64. create_date,update_date)
  65. values
  66. <foreach collection="configList" item="item" index="index" separator=",">
  67. (#{item.id,jdbcType=BIGINT},
  68. #{item.activityId,jdbcType=BIGINT},#{item.parentId,jdbcType=BIGINT},#{item.name,jdbcType=VARCHAR},
  69. #{item.createDate,jdbcType=TIMESTAMP},#{item.updateDate,jdbcType=TIMESTAMP})
  70. </foreach>
  71. </insert>
  72. <select id="findActivityCount" parameterType="com.iformall.domain.po.WxLegionActivityConfig" resultType="com.iformall.domain.vo.LegionActivityCount">
  73. select activity_id as 'activityId',
  74. count(1) as 'count'
  75. from wx_legion_activity_config
  76. where 1 = 1
  77. <if test=" null != tenantId and '' != tenantId">
  78. and `tenant_id` = #{tenantId}
  79. </if>
  80. <if test=" null != parentTenantId and '' != parentTenantId">
  81. and `parent_tenant_id` = #{parentTenantId}
  82. </if>
  83. <if test=" null != activityId ">
  84. and `activity_id` = #{activityId}
  85. </if>
  86. <if test=" null != parentId ">
  87. and `parent_id` = #{parentId}
  88. </if>
  89. <if test=" null != activityIdList ">
  90. and `activity_id` in
  91. <foreach collection="activityIdList" index="index" item="idItem" open="(" separator="," close=")">
  92. #{idItem}
  93. </foreach>
  94. </if>
  95. group by activity_id
  96. </select>
  97. </mapper>