25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

125 satır
4.4 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxActivityMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxActivity">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  8. <result column="title" jdbcType="VARCHAR" property="title"/>
  9. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  10. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  11. <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
  12. <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  13. <result column="type" jdbcType="INTEGER" property="type"/>
  14. <result column="status" jdbcType="INTEGER" property="status"/>
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  16. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  17. <result column="html" jdbcType="VARCHAR" property="html"/>
  18. <result column="person_limit" jdbcType="INTEGER" property="personLimit"/>
  19. <result column="activity_start_time" jdbcType="TIMESTAMP" property="activityStartTime"/>
  20. <result column="activity_end_time" jdbcType="TIMESTAMP" property="activityEndTime"/>
  21. <result column="use_credit" jdbcType="INTEGER" property="useCredit"/>
  22. <result column="credit" jdbcType="INTEGER" property="credit"/>
  23. <result column="question" jdbcType="VARCHAR" property="question"/>
  24. <result column="is_expired" jdbcType="INTEGER" property="isExpired"/>
  25. <result column="use_img" jdbcType="INTEGER" property="useImg"/>
  26. <result column="img_detail" jdbcType="VARCHAR" property="imgDetail"/>
  27. <result column="send_msg" jdbcType="INTEGER" property="sendMsg"/>
  28. </resultMap>
  29. <sql id="allColumns">
  30. `id`,`tenant_id`,`cover_img`,`title`,`sub_title`,`detail`,`html`,`person_limit`,`activity_start_time`,`activity_end_time`,
  31. `use_credit`,`credit`,`type`,`status`,`start_time`,`end_time`,`question`,`is_expired`,`create_time`,`update_time`,`use_img`,
  32. `img_detail`,`send_msg`
  33. </sql>
  34. <sql id="dynamicWhereConditions">
  35. where 1 = 1
  36. <if test=" null != id ">
  37. and `id` = #{id}
  38. </if>
  39. <if test=" null != tenantId ">
  40. and `tenant_id` = #{tenantId}
  41. </if>
  42. <if test=" null != title ">
  43. and `title` like concat('%', #{title},'%')
  44. </if>
  45. <if test=" null != subTitle ">
  46. and `sub_title` like concat('%', #{subTitle},'%')
  47. </if>
  48. <if test=" null != detail ">
  49. and `detail` like concat('%', #{detail},'%')
  50. </if>
  51. <if test=" null != type ">
  52. and `type` = #{type}
  53. </if>
  54. <if test=" null != status ">
  55. and `status` = #{status}
  56. </if>
  57. <if test=" null != createTime ">
  58. and `create_time` = #{createTime}
  59. </if>
  60. <if test=" null != updateTime ">
  61. and `update_time` = #{updateTime}
  62. </if>
  63. <if test=" null != useCredit ">
  64. and `use_credit` = #{useCredit}
  65. </if>
  66. <if test=" null != isExpired ">
  67. and `is_expired` = #{isExpired}
  68. </if>
  69. <if test=" null != starttime and null!=endtime ">
  70. and `create_time` between #{starttime} and #{endtime}
  71. </if>
  72. <if test=" null != sendMsg ">
  73. and `send_msg` = #{sendMsg}
  74. </if>
  75. <if test=" null != ids ">
  76. and id in
  77. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  78. #{idItem}
  79. </foreach>
  80. </if>
  81. <if test=" null != sortColumns">order by ${sortColumns}</if>
  82. </sql>
  83. <select id="findList" parameterType="com.iformall.domain.po.WxActivity" resultMap="BaseResultMap">
  84. select
  85. <include refid="allColumns"/>
  86. from wx_activity
  87. <include refid="dynamicWhereConditions"/>
  88. </select>
  89. <select id="queryNotify" parameterType="com.iformall.domain.po.WxActivity"
  90. resultType="com.iformall.domain.po.WxActivity">
  91. select id,title,activity_start_time,tenant_id from wx_activity
  92. where status=${status}
  93. and DATEDIFF(activity_start_time,now())=3
  94. </select>
  95. <update id="activityExipred" parameterType="com.iformall.domain.po.WxActivity">
  96. update wx_activity set is_expired=${isExpired},update_time=#{updateTime} where status=${status} and now()>end_time
  97. </update>
  98. <update id="activityCompletion" parameterType="com.iformall.domain.po.WxActivity">
  99. update wx_activity set status=#{status},update_time=#{updateTime} where status!=${status} and now()>activity_end_time
  100. </update>
  101. </mapper>