fix store diary page
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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.imyeyu.api.modules.gao.mapper.GaoStoreDiaryMapper">
|
||||
<sql id="monthWhere">
|
||||
`biz_type` = 'GAO_STORE_DIARY'
|
||||
AND `biz_id` = #{storeId}
|
||||
AND `created_at` >= #{beginCreatedAt}
|
||||
AND `created_at` < #{endCreatedAt}
|
||||
AND (`deleted_at` IS NULL OR FLOOR(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000) < `deleted_at`)
|
||||
</sql>
|
||||
|
||||
<select id="selectByMonth" resultType="com.imyeyu.api.modules.common.entity.Article">
|
||||
SELECT
|
||||
`id`,
|
||||
`biz_type`,
|
||||
`biz_id`,
|
||||
`title`,
|
||||
`description`,
|
||||
`content_type`,
|
||||
`reads`,
|
||||
`likes`,
|
||||
`status`,
|
||||
`updated_by`,
|
||||
`created_at`,
|
||||
`updated_at`,
|
||||
`deleted_at`
|
||||
FROM `article`
|
||||
WHERE
|
||||
<include refid="monthWhere"/>
|
||||
ORDER BY `created_at` DESC, `id` DESC
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="countByMonth" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM `article`
|
||||
WHERE
|
||||
<include refid="monthWhere"/>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user