后台服务
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

132 lignes
5.1 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.WxActivityJoinMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxActivityJoin">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  9. <result column="activity_id" jdbcType="BIGINT" property="activityId"/>
  10. <result column="name" jdbcType="VARCHAR" property="name"/>
  11. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  12. <result column="birthday" jdbcType="TIMESTAMP" property="birthday"/>
  13. <result column="sex" jdbcType="INTEGER" property="sex"/>
  14. <result column="age" jdbcType="INTEGER" property="age"/>
  15. <result column="number" jdbcType="INTEGER" property="number"/>
  16. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  17. <result column="address" jdbcType="VARCHAR" property="address"/>
  18. <result column="answer" jdbcType="VARCHAR" property="answer"/>
  19. <result column="sign_in" jdbcType="INTEGER" property="signIn"/>
  20. <result column="status" jdbcType="INTEGER" property="status"/>
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  22. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  23. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  24. <result column="send_msg" jdbcType="INTEGER" property="sendMsg"/>
  25. </resultMap>
  26. <sql id="allColumns">
  27. `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`age`,`number`,`phone`,
  28. `address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg`
  29. </sql>
  30. <sql id="dynamicWhereConditions">
  31. where 1 = 1
  32. <if test=" null != id ">
  33. and `id` = #{id}
  34. </if>
  35. <if test=" null != tenantId and '' != tenantId">
  36. and `tenant_id` = #{tenantId}
  37. </if>
  38. <if test=" null != parentTenantId and '' != parentTenantId">
  39. and `parent_tenant_id` = #{parentTenantId}
  40. </if>
  41. <if test=" null != name and ''!=name">
  42. and `name` like concat('%', #{name},'%')
  43. </if>
  44. <if test=" null != phone and ''!=phone">
  45. and `phone` = #{phone}
  46. </if>
  47. <if test=" null != sex ">
  48. and `sex` = #{sex}
  49. </if>
  50. <if test=" null != signIn ">
  51. and `sign_in` = #{signIn}
  52. </if>
  53. <if test=" null != status ">
  54. and `status` = #{status}
  55. </if>
  56. <if test=" null != activityId ">
  57. and `activity_id` = #{activityId}
  58. </if>
  59. <if test=" null != sendMsg ">
  60. and `send_msg` = #{sendMsg}
  61. </if>
  62. <if test=" null != ids ">
  63. and id in
  64. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  65. #{idItem}
  66. </foreach>
  67. </if>
  68. <if test=" null != sortColumns">order by ${sortColumns}</if>
  69. </sql>
  70. <select id="findList" parameterType="com.iformall.domain.po.WxActivityJoin" resultMap="BaseResultMap">
  71. select
  72. <include refid="allColumns"/>
  73. from wx_activity_join
  74. <include refid="dynamicWhereConditions"/>
  75. </select>
  76. <select id="cfindList" parameterType="com.iformall.domain.po.WxActivityJoin"
  77. resultType="com.iformall.domain.po.WxActivity">
  78. select a.`id`,a.`tenant_id`,a.`parent_tenant_id`,a.`cover_img`,a.`title`,a.`sub_title`,a.`detail`,a.`html`,a.`activity_type`,a.`signup_examine`,a.`person_limit`,a.`activity_start_time`,a.`activity_end_time`,
  79. a.`use_credit`,a.`credit`,a.`type`,a.`status`,a.`start_time`,a.`end_time`,a.`question`,a.`is_expired`,a.`create_time`,a.`update_time`,a.`use_img`,
  80. a.`img_detail`,a.`send_msg`,a.`selectques`,aj.`status` join_status
  81. from wx_activity_join aj
  82. left join wx_activity a on aj.activity_id=a.id
  83. where aj.user_id=#{userId}
  84. <if test=" null != tenantId and '' != tenantId">
  85. and aj.`tenant_id` = #{tenantId}
  86. </if>
  87. <if test=" null != parentTenantId and '' != parentTenantId">
  88. and aj.`parent_tenant_id` = #{parentTenantId}
  89. </if>
  90. <if test=" null != statusStr and '' != statusStr">
  91. and a.`status` in (${statusStr})
  92. </if>
  93. <!-- <if test=" null != statusStr and ''!=statusStr">-->
  94. <!-- and aj.`status` in (${statusStr}) and a.`status`=2-->
  95. <!-- </if>-->
  96. <!-- <if test=" null != status">-->
  97. <!-- and a.`status`= 1-->
  98. <!-- </if>-->
  99. <if test=" null != status">
  100. and aj.`status`= #{status}
  101. </if>
  102. <if test=" null != sortColumns">order by aj.${sortColumns}</if>
  103. </select>
  104. <update id="updateSendMsg" parameterType="hashmap">
  105. update wx_activity_join set send_msg = #{send_msg} where id in
  106. <foreach collection="joinList" index="index" item="join" open="(" separator="," close=")">
  107. #{join.id}
  108. </foreach>
  109. </update>
  110. <update id="updateStatus" parameterType="java.util.List">
  111. update wx_activity_join set status = 3 where activity_id in
  112. <foreach collection="list" index="index" item="activity" open="(" separator="," close=")">
  113. #{activity.id}
  114. </foreach>
  115. </update>
  116. <update id="activityExpired">
  117. update wx_activity_join set `status`=2,update_time=now() where `status`= 0 and activity_id in (select id from wx_activity where is_expired=1)
  118. </update>
  119. </mapper>