Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

65 строки
2.0 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.WxTopicMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTopic">
  5. <id column="id" property="id" />
  6. <result column="tenant_id" property="tenantId" />
  7. <result column="name" property="name" />
  8. <result column="title" property="title" />
  9. <result column="content" property="content" />
  10. <result column="cover" property="cover" />
  11. <result column="advert" property="advert" />
  12. <result column="begin_time" property="beginTime" />
  13. <result column="end_time" property="endTime" />
  14. <result column="status" property="status" />
  15. <result column="createtime" property="createtime" />
  16. <result column="updatetime" property="updatetime" />
  17. <result column="bg_color" property="bgColor" />
  18. </resultMap>
  19. <sql id="allColumns">
  20. `id`,`tenant_id`,`name`,`title`,content,cover,advert,begin_time,end_time,createtime,updatetime,bg_color
  21. </sql>
  22. <sql id="dynamicWhereConditions">
  23. where 1 = 1
  24. <if test=" null != id ">
  25. and `id` = #{id}
  26. </if>
  27. <if test=" null != tenantId ">
  28. and `tenant_id` = #{tenantId}
  29. </if>
  30. <if test=" null != status ">
  31. and `status` = #{status}
  32. </if>
  33. <if test=" null != status ">
  34. and `status` = #{status}
  35. </if>
  36. <if test=" null != beginTime ">
  37. and `begin_time` >= #{beginTime}
  38. </if>
  39. <if test=" null != endTime ">
  40. and `end_time` &lt;= #{endTime}
  41. </if>
  42. <if test=" null != statusStr and '' != statusStr">
  43. and `status` in (#{statusStr})
  44. </if>
  45. order by createtime desc
  46. </sql>
  47. <select id="findList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
  48. select * from wx_topic
  49. <include refid="dynamicWhereConditions" />
  50. </select>
  51. <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
  52. select * from wx_topic t where t.status = 1
  53. and now() >= t.begin_time and now() &lt;= t.end_time
  54. order by t.createtime desc limit 1
  55. </select>
  56. </mapper>