Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

110 wiersze
3.9 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="user_id" jdbcType="BIGINT" property="userId"/>
  8. <result column="activity_id" jdbcType="BIGINT" property="activityId"/>
  9. <result column="name" jdbcType="VARCHAR" property="name"/>
  10. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  11. <result column="birthday" jdbcType="TIMESTAMP" property="birthday"/>
  12. <result column="sex" jdbcType="INTEGER" property="sex"/>
  13. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  14. <result column="address" jdbcType="VARCHAR" property="address"/>
  15. <result column="answer" jdbcType="VARCHAR" property="answer"/>
  16. <result column="sign_in" jdbcType="INTEGER" property="signIn"/>
  17. <result column="status" jdbcType="INTEGER" property="status"/>
  18. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  19. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  20. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  21. <result column="send_msg" jdbcType="INTEGER" property="sendMsg"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. `id`,`tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`,
  25. `address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1 = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != tenantId ">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != name and ''!=name">
  36. and `name` like concat('%', #{name},'%')
  37. </if>
  38. <if test=" null != phone and ''!=phone">
  39. and `phone` = #{phone}
  40. </if>
  41. <if test=" null != sex ">
  42. and `sex` = #{sex}
  43. </if>
  44. <if test=" null != signIn ">
  45. and `sign_in` = #{signIn}
  46. </if>
  47. <if test=" null != status ">
  48. and `status` = #{status}
  49. </if>
  50. <if test=" null != activityId ">
  51. and `activity_id` = #{activityId}
  52. </if>
  53. <if test=" null != sendMsg ">
  54. and `send_msg` = #{sendMsg}
  55. </if>
  56. <if test=" null != ids ">
  57. and id in
  58. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  59. #{idItem}
  60. </foreach>
  61. </if>
  62. <if test=" null != sortColumns">order by ${sortColumns}</if>
  63. </sql>
  64. <select id="findList" parameterType="com.iformall.domain.po.WxActivityJoin" resultMap="BaseResultMap">
  65. select
  66. <include refid="allColumns"/>
  67. from wx_activity_join
  68. <include refid="dynamicWhereConditions"/>
  69. </select>
  70. <select id="cfindList" parameterType="com.iformall.domain.po.WxActivityJoin"
  71. resultType="com.iformall.domain.po.WxActivity">
  72. select a.id,a.cover_img,a.title,a.activity_start_time,a.activity_end_time,aj.`status`
  73. from wx_activity_join aj left join wx_activity a on aj.activity_id=a.id
  74. where aj.user_id=#{userId}
  75. <if test=" null != tenantId ">
  76. and aj.`tenant_id` = #{tenantId}
  77. </if>
  78. <if test=" null != statusStr and ''!=statusStr">
  79. and aj.`status` in (${statusStr})
  80. </if>
  81. <if test=" null != status">
  82. and a.`status`= 1
  83. </if>
  84. <if test=" null != sortColumns">order by aj.${sortColumns}</if>
  85. </select>
  86. <update id="updateSendMsg" parameterType="hashmap">
  87. update wx_activity_join set send_msg = #{send_msg} where id in
  88. <foreach collection="joinList" index="index" item="join" open="(" separator="," close=")">
  89. #{join.id}
  90. </foreach>
  91. </update>
  92. <update id="updateStatus" parameterType="java.util.List">
  93. update wx_activity_join set status = 3 where activity_id in
  94. <foreach collection="list" index="index" item="activity" open="(" separator="," close=")">
  95. #{activity.id}
  96. </foreach>
  97. </update>
  98. </mapper>