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

58 строки
1.8 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. </resultMap>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != tenantId ">
  24. and `tenant_id` = #{tenantId}
  25. </if>
  26. <if test=" null != status ">
  27. and `status` = #{status}
  28. </if>
  29. <if test=" null != name and '' != name ">
  30. and `name` like concat('%', #{name},'%')
  31. </if>
  32. <if test=" null != beginTime ">
  33. and `begin_time` >= #{beginTime}
  34. </if>
  35. <if test=" null != endTime ">
  36. and `end_time` &lt;= #{endTime}
  37. </if>
  38. order by createtime desc
  39. </sql>
  40. <select id="findList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
  41. select * from wx_topic
  42. <include refid="dynamicWhereConditions" />
  43. </select>
  44. <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
  45. select * from wx_topic t where t.status = 1
  46. and now() >= t.begin_time and now() &lt;= t.end_time
  47. order by t.createtime desc limit 1
  48. </select>
  49. </mapper>