|
@@ -0,0 +1,312 @@
|
|
|
+<?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.caimei365.commodity.mapper.CmPraiseStatisticsMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.caimei365.commodity.model.po.CmPraiseStatistics" id="CmPraiseStatisticsResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="authorId" column="authorId" />
|
|
|
+ <result property="num" column="num" />
|
|
|
+ <result property="pv" column="pv" />
|
|
|
+ <result property="delFlag" column="delFlag" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCmPraiseStatisticsVo">
|
|
|
+ select
|
|
|
+ cm_praise_statistics.id,
|
|
|
+ cm_praise_statistics.type,
|
|
|
+ cm_praise_statistics.authorId,
|
|
|
+ cm_praise_statistics.num,
|
|
|
+ cm_praise_statistics.pv,
|
|
|
+ cm_praise_statistics.delFlag
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getByCmPraiseStatistics" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics" resultMap="CmPraiseStatisticsResult">
|
|
|
+ <include refid="selectCmPraiseStatisticsVo"/>
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where> cm_praise_statistics.delFlag = 0
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_praise_statistics.id
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmPraiseStatisticsList" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics" resultMap="CmPraiseStatisticsResult">
|
|
|
+ <include refid="selectCmPraiseStatisticsVo"/>
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where> cm_praise_statistics.delFlag = 0
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_praise_statistics.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmPraiseStatisticsCount" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics" resultType="String">
|
|
|
+ select count(1)
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where> cm_praise_statistics.delFlag = 0
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_praise_statistics.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmPraiseStatisticsById" parameterType="String" resultMap="CmPraiseStatisticsResult">
|
|
|
+ <include refid="selectCmPraiseStatisticsVo"/>
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ where cm_praise_statistics.delFlag = 0 and cm_praise_statistics.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getByIds" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics" resultType="String">
|
|
|
+ select id
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where> cm_praise_statistics.delFlag = 0
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_praise_statistics.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getById" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics" resultType="String">
|
|
|
+ select id
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where> cm_praise_statistics.delFlag = 0
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_praise_statistics.id
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="addCmPraiseStatistics" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics">
|
|
|
+ insert into cm_praise_statistics
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
+ <if test="type != null and type != ''">type,</if>
|
|
|
+ <if test="authorId != null and authorId != ''">authorId,</if>
|
|
|
+ <if test="num != null">num,</if>
|
|
|
+ <if test="pv != null">pv,</if>
|
|
|
+ <if test="delFlag != null">delFlag,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
+ <if test="type != null and type != ''">#{type},</if>
|
|
|
+ <if test="authorId != null and authorId != ''">#{authorId},</if>
|
|
|
+ <if test="num != null">#{num},</if>
|
|
|
+ <if test="pv != null">#{pv},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCmPraiseStatistics" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics">
|
|
|
+ update cm_praise_statistics
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="type != null and type != ''">type = #{type},</if>
|
|
|
+ <if test="authorId != null and authorId != ''">authorId = #{authorId},</if>
|
|
|
+ <if test="num != null">num = #{num},</if>
|
|
|
+ <if test="pv != null">pv = #{pv},</if>
|
|
|
+ <if test="delFlag != null">delFlag = #{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateDelCmPraiseStatisticsByIds" parameterType="String">
|
|
|
+ update cm_praise_statistics set delFlag=#{delFlag} where id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delCmPraiseStatisticsById" parameterType="String">
|
|
|
+ delete
|
|
|
+ from cm_praise_statistics where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="delCmPraiseStatistics" parameterType="com.caimei365.commodity.model.po.CmPraiseStatistics">
|
|
|
+ delete
|
|
|
+ from cm_praise_statistics AS cm_praise_statistics
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and cm_praise_statistics.id
|
|
|
+ <if test="id.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{idIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ and cm_praise_statistics.type
|
|
|
+ <if test="type.toUpperCase().indexOf('=')==-1">
|
|
|
+ = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
|
|
|
+ <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
|
|
|
+ <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
|
|
|
+ #{typeIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="authorId != null and authorId != ''"> and cm_praise_statistics.authorId = #{authorId}</if>
|
|
|
+ <if test="num != null "> and cm_praise_statistics.num = #{num}</if>
|
|
|
+ <if test="pv != null "> and cm_praise_statistics.pv = #{pv}</if>
|
|
|
+ <if test="delFlag != null "> and cm_praise_statistics.delFlag = #{delFlag}</if>
|
|
|
+ </where>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="delCmPraiseStatisticsByIds" parameterType="String">
|
|
|
+ delete from cm_praise_statistics where id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|