|
|
@@ -0,0 +1,181 @@
|
|
|
+<?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.goafanti.common.dao.AdminProjectStatisticsMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.common.model.AdminProjectStatistics" id="AdminProjectStatisticsMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="aid" column="aid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="htsatcount" column="htSatCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="htsatscorecount" column="htSatScoreCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="htsatscoreaverage" column="htSatScoreAverage" jdbcType="INTEGER"/>
|
|
|
+ <result property="membercount" column="memberCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="memberscorecount" column="memberScoreCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="memberscoreaverage" column="memberScoreAverage" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="AdminProjectStatisticsAllSql">
|
|
|
+ id, aid, htSatCount, htSatScoreCount, htSatScoreAverage, memberCount, memberScoreCount, memberScoreAverage, create_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="AdminProjectStatisticsMap">
|
|
|
+ select
|
|
|
+ <include refid="AdminProjectStatisticsAllSql"/>
|
|
|
+ from admin_project_statistics
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findAdminProjectStatisticsList" resultMap="AdminProjectStatisticsMap">
|
|
|
+ select
|
|
|
+ <include refid="AdminProjectStatisticsAllSql"/>
|
|
|
+
|
|
|
+ from admin_project_statistics
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="htsatcount != null">
|
|
|
+ and htSatCount = #{htsatcount}
|
|
|
+ </if>
|
|
|
+ <if test="htsatscorecount != null">
|
|
|
+ and htSatScoreCount = #{htsatscorecount}
|
|
|
+ </if>
|
|
|
+ <if test="htsatscoreaverage != null">
|
|
|
+ and htSatScoreAverage = #{htsatscoreaverage}
|
|
|
+ </if>
|
|
|
+ <if test="membercount != null">
|
|
|
+ and memberCount = #{membercount}
|
|
|
+ </if>
|
|
|
+ <if test="memberscorecount != null">
|
|
|
+ and memberScoreCount = #{memberscorecount}
|
|
|
+ </if>
|
|
|
+ <if test="memberscoreaverage != null">
|
|
|
+ and memberScoreAverage = #{memberscoreaverage}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findAdminProjectStatisticsCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from admin_project_statistics
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="htsatcount != null">
|
|
|
+ and htSatCount = #{htsatcount}
|
|
|
+ </if>
|
|
|
+ <if test="htsatscorecount != null">
|
|
|
+ and htSatScoreCount = #{htsatscorecount}
|
|
|
+ </if>
|
|
|
+ <if test="htsatscoreaverage != null">
|
|
|
+ and htSatScoreAverage = #{htsatscoreaverage}
|
|
|
+ </if>
|
|
|
+ <if test="membercount != null">
|
|
|
+ and memberCount = #{membercount}
|
|
|
+ </if>
|
|
|
+ <if test="memberscorecount != null">
|
|
|
+ and memberScoreCount = #{memberscorecount}
|
|
|
+ </if>
|
|
|
+ <if test="memberscoreaverage != null">
|
|
|
+ and memberScoreAverage = #{memberscoreaverage}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into admin_project_statistics(aid, htSatCount, htSatScoreCount, htSatScoreAverage, memberCount,
|
|
|
+ memberScoreCount, memberScoreAverage, create_time)
|
|
|
+ values (#{aid}, #{htsatcount}, #{htsatscorecount}, #{htsatscoreaverage}, #{membercount}, #{memberscorecount},
|
|
|
+ #{memberscoreaverage}, #{createTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into admin_project_statistics(aid, htSatCount, htSatScoreCount, htSatScoreAverage, memberCount,
|
|
|
+ memberScoreCount, memberScoreAverage, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.aid}, #{entity.htsatcount}, #{entity.htsatscorecount}, #{entity.htsatscoreaverage},
|
|
|
+ #{entity.membercount}, #{entity.memberscorecount}, #{entity.memberscoreaverage}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into admin_project_statistics(aid, htSatCount, htSatScoreCount, htSatScoreAverage, memberCount,
|
|
|
+ memberScoreCount, memberScoreAverage, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.aid}, #{entity.htsatcount}, #{entity.htsatscorecount}, #{entity.htsatscoreaverage},
|
|
|
+ #{entity.membercount}, #{entity.memberscorecount}, #{entity.memberscoreaverage}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ aid = values(aid),
|
|
|
+ htSatCount = values(htSatCount),
|
|
|
+ htSatScoreCount = values(htSatScoreCount),
|
|
|
+ htSatScoreAverage = values(htSatScoreAverage),
|
|
|
+ memberCount = values(memberCount),
|
|
|
+ memberScoreCount = values(memberScoreCount),
|
|
|
+ memberScoreAverage = values(memberScoreAverage),
|
|
|
+ create_time = values(create_time)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update admin_project_statistics
|
|
|
+ <set>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ aid = #{aid},
|
|
|
+ </if>
|
|
|
+ <if test="htsatcount != null">
|
|
|
+ htSatCount = #{htsatcount},
|
|
|
+ </if>
|
|
|
+ <if test="htsatscorecount != null">
|
|
|
+ htSatScoreCount = #{htsatscorecount},
|
|
|
+ </if>
|
|
|
+ <if test="htsatscoreaverage != null">
|
|
|
+ htSatScoreAverage = #{htsatscoreaverage},
|
|
|
+ </if>
|
|
|
+ <if test="membercount != null">
|
|
|
+ memberCount = #{membercount},
|
|
|
+ </if>
|
|
|
+ <if test="memberscorecount != null">
|
|
|
+ memberScoreCount = #{memberscorecount},
|
|
|
+ </if>
|
|
|
+ <if test="memberscoreaverage != null">
|
|
|
+ memberScoreAverage = #{memberscoreaverage},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from admin_project_statistics
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|