|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxTopicMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTopic">
- <id column="id" property="id" />
- <result column="tenant_id" property="tenantId" />
- <result column="name" property="name" />
- <result column="title" property="title" />
- <result column="content" property="content" />
- <result column="cover" property="cover" />
- <result column="advert" property="advert" />
- <result column="begin_time" property="beginTime" />
- <result column="end_time" property="endTime" />
- <result column="status" property="status" />
- <result column="createtime" property="createtime" />
- <result column="updatetime" property="updatetime" />
-
- </resultMap>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId ">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != status ">
- and `status` = #{status}
- </if>
-
- <if test=" null != name and '' != name ">
- and `name` like concat('%', #{name},'%')
- </if>
- <if test=" null != beginTime ">
- and `begin_time` >= #{beginTime}
- </if>
- <if test=" null != endTime ">
- and `end_time` <= #{endTime}
- </if>
- order by createtime desc
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
- select * from wx_topic
- <include refid="dynamicWhereConditions" />
- </select>
-
- <select id="show" parameterType="com.iformall.domain.po.WxTopic" resultMap="BaseResultMap">
- select * from wx_topic t where t.status = 1
- and now() >= t.begin_time and now() <= t.end_time
- order by t.createtime desc limit 1
- </select>
-
-
- </mapper>
|