You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

91 lines
3.2 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="img_url"/>
  21. </resultMap>
  22. <sql id="allColumns">
  23. `id`,`tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`,
  24. `address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1 = 1
  28. <if test=" null != id ">
  29. and `id` = #{id}
  30. </if>
  31. <if test=" null != tenantId ">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != name and ''!=name">
  35. and `name` like concat('%', #{name},'%')
  36. </if>
  37. <if test=" null != phone and ''!=phone">
  38. and `phone` = #{phone}
  39. </if>
  40. <if test=" null != sex ">
  41. and `sex` = #{sex}
  42. </if>
  43. <if test=" null != signIn ">
  44. and `sign_in` = #{signIn}
  45. </if>
  46. <if test=" null != status ">
  47. and `status` = #{status}
  48. </if>
  49. <if test=" null != activityId ">
  50. and `activity_id` = #{activityId}
  51. </if>
  52. <if test=" null != ids ">
  53. and id in
  54. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  55. #{idItem}
  56. </foreach>
  57. </if>
  58. <if test=" null != sortColumns">order by ${sortColumns}</if>
  59. </sql>
  60. <select id="findList" parameterType="com.iformall.domain.po.WxActivityJoin" resultMap="BaseResultMap">
  61. select
  62. <include refid="allColumns"/>
  63. from wx_activity_join
  64. <include refid="dynamicWhereConditions"/>
  65. </select>
  66. <select id="cfindList" parameterType="com.iformall.domain.po.WxActivityJoin"
  67. resultType="com.iformall.domain.po.WxActivity">
  68. select a.cover_img,a.title,a.activity_start_time,activity_end_time,a.`status`
  69. from wx_activity_join aj left join wx_activity a on aj.activity_id=a.id
  70. where aj.user_id=#{user_id}
  71. <if test=" null != tenantId ">
  72. and `tenant_id` = #{tenantId}
  73. </if>
  74. <if test=" null != statusStr and ''!=statusStr">
  75. and `status` in (${statusStr})
  76. </if>
  77. <if test=" null != status">
  78. and `status`= #{status}
  79. </if>
  80. <if test=" null != sortColumns">order by ${sortColumns}</if>
  81. </select>
  82. </mapper>