后台服务
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.

WxQuestionOneselfMapper.xml 4.0 KiB

2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.WxQuestionOneselfMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneself">
  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="logo" jdbcType="VARCHAR" property="logo"/>
  9. <result column="top_pic" jdbcType="VARCHAR" property="topPic"/>
  10. <result column="title" jdbcType="VARCHAR" property="title"/>
  11. <result column="top_desc" jdbcType="VARCHAR" property="topDesc"/>
  12. <result column="status" jdbcType="TINYINT" property="status"/>
  13. <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
  14. <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/>
  15. <result column="reward_credit" jdbcType="INTEGER" property="rewardCredit"/>
  16. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  17. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  18. <result column="sort" jdbcType="INTEGER" property="sort"/>
  19. <result column="count_topic" jdbcType="INTEGER" property="countTopic"/>
  20. <result column="count_user" jdbcType="INTEGER" property="countUser"/>
  21. <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. `id`,`tenant_id`,`parent_tenant_id`, `logo`, `top_pic`, `title`, `top_desc`, `status`, `start_date`, `end_date`,
  25. `reward_credit`,`create_date`,`update_date`,`sort`, `qr_code`, `count_topic`, `count_user`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where `del_status` = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != tenantId and '' != tenantId">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != parentTenantId and '' != parentTenantId">
  36. and `parent_tenant_id` = #{parentTenantId}
  37. </if>
  38. <if test=" null != title ">
  39. and `title` like concat('%', #{title},'%')
  40. </if>
  41. <if test=" null != status and status lt 3">
  42. and `status` = #{status}
  43. </if>
  44. <if test=" null != status and status == 3">
  45. and `status` &gt;= 2 and `status` &lt;= 3
  46. </if>
  47. <if test=" null != status and status == 4">
  48. and `status` &gt; 0
  49. </if>
  50. <if test=" null != createStartdate ">
  51. and `create_date` &gt;= #{createStartdate}
  52. </if>
  53. <if test=" null != createEnddate ">
  54. and `create_date` &lt;= #{createEnddate}
  55. </if>
  56. <if test=" null != startStartdate ">
  57. and `start_date` &gt;= #{startStartdate}
  58. </if>
  59. <if test=" null != startEnddate ">
  60. and `start_date` &lt;= #{startEnddate}
  61. </if>
  62. <if test=" null != endStartdate ">
  63. and `end_date` &gt;= #{endStartdate}
  64. </if>
  65. <if test=" null != endEnddate ">
  66. and `end_date` &lt;= #{endEnddate}
  67. </if>
  68. <if test=" null != ids ">
  69. and id in
  70. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  71. #{idItem}
  72. </foreach>
  73. </if>
  74. <if test=" null != sortColumns">order by ${sortColumns}</if>
  75. </sql>
  76. <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneself" resultMap="BaseResultMap">
  77. select
  78. <include refid="allColumns"/>
  79. from wx_question_oneself
  80. <include refid="dynamicWhereConditions"/>
  81. </select>
  82. <update id="updateCountUser" parameterType="Long">
  83. update wx_question_oneself set count_user = count_user+1
  84. where id = #{id}
  85. </update>
  86. </mapper>