|
|
@@ -2,163 +2,182 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.goafanti.common.dao.PublicReleaseCountMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicReleaseCount">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
- <result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
- <result column="count" jdbcType="INTEGER" property="count" />
|
|
|
- <result column="hour" jdbcType="DOUBLE" property="hour" />
|
|
|
- <result column="no_approved" jdbcType="INTEGER" property="noApproved" />
|
|
|
- <result column="reject" jdbcType="INTEGER" property="reject" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="province" jdbcType="INTEGER" property="province" />
|
|
|
+ <result column="dep_id" jdbcType="VARCHAR" property="depId" />
|
|
|
+ <result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
|
+ <result column="quantity" jdbcType="INTEGER" property="quantity" />
|
|
|
+ <result column="new_user" jdbcType="INTEGER" property="newUser" />
|
|
|
+ <result column="total" jdbcType="DECIMAL" property="total" />
|
|
|
+ <result column="date" jdbcType="VARCHAR" property="date" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
- id, aid, `count`, `hour`, no_approved, reject, create_time
|
|
|
+ id, province, dep_id, `uid`, quantity, new_user, total, `date`
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from public_release_count
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
+ <select id="followStatisticsList" resultType="com.goafanti.user.bo.outFollowStatisticsList">
|
|
|
+ select z.*,(z.totalQuantity/z.totalInterview)totalRatio from(select name,use_interview useInterview,
|
|
|
+ use_quantity useQuantity,use_total useTotal,(use_quantity/use_interview)useRatio,
|
|
|
+ new_interview newInterview,new_quantity newQuantity,new_total newTotal,(new_quantity/new_interview)newRatio,
|
|
|
+ (use_interview+new_interview)totalInterview,(use_quantity+new_quantity)totalQuantity,(use_total+new_total)total
|
|
|
+ from (select dg.name,sum(use_interview)use_interview,sum(use_quantity)use_quantity,sum(use_total)use_total,
|
|
|
+ sum(new_interview)new_interview,sum(new_quantity)new_quantity,sum(new_total)new_total
|
|
|
+ from (select province,if(new_user=1,1,0)use_interview,if(new_user=1,a.quantity ,0)use_quantity,
|
|
|
+ if(new_user=1,a.total ,0)use_total,if(new_user=0,1,0)new_interview,if(new_user=0,a.quantity ,0)new_quantity,
|
|
|
+ if(new_user=0,a.total ,0)new_total from public_release_count a
|
|
|
+ where a.`date` = #{date}
|
|
|
+ <if test="depId !=null">
|
|
|
+ and a.dep_id= #{depId}
|
|
|
+ </if>
|
|
|
+ <if test="province !=null">
|
|
|
+ and a.province= #{province}
|
|
|
+ </if>
|
|
|
+ )x
|
|
|
+ left join district_glossory dg on x.province=dg.id group by dg.id )y )z
|
|
|
+ order by
|
|
|
+ <if test="sort==0">
|
|
|
+ totalQuantity
|
|
|
+ </if>
|
|
|
+ <if test="sort==1">
|
|
|
+ total
|
|
|
+ </if>
|
|
|
+ <if test="sort==2">
|
|
|
+ totalInterview
|
|
|
+ </if>
|
|
|
+ desc
|
|
|
+ </select>
|
|
|
+ <select id="provinceFollowStatisticsList" resultType="com.goafanti.user.bo.outProvinceFollowStatistic">
|
|
|
+ select x.name,c.nickname ,x.new_user newUser,d.counts interviewCount,x.quantity
|
|
|
+ from (select b.name,a.new_user,a.uid,sum(a.quantity)quantity from public_release_count a left join department b on a.dep_id =b.id
|
|
|
+ where a.date= #{date} and a.province = #{province}
|
|
|
+ <if test="depId !=null">
|
|
|
+ and a.dep_id = #{depId}
|
|
|
+ </if>
|
|
|
+ group by b.name ,a.uid ,a.new_user )x
|
|
|
+ left join `user` c on x.uid =c.id left join (select uid,count(*)counts from public_release group by uid) d on x.uid =d.uid
|
|
|
+ order by
|
|
|
+ <if test="sort==0">
|
|
|
+ d.counts
|
|
|
+ </if>
|
|
|
+ <if test="sort==1">
|
|
|
+ x.quantity
|
|
|
+ </if>
|
|
|
+ desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
delete from public_release_count
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.PublicReleaseCount">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
- insert into public_release_count (id, aid, `count`,
|
|
|
- `hour`, no_approved, reject,
|
|
|
- create_time)
|
|
|
- values (#{id,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER},
|
|
|
- #{hour,jdbcType=DOUBLE}, #{noApproved,jdbcType=INTEGER}, #{reject,jdbcType=INTEGER},
|
|
|
- #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseCount" useGeneratedKeys="true">
|
|
|
+ insert into public_release_count (province, dep_id, `uid`,
|
|
|
+ quantity, new_user, total,
|
|
|
+ `date`)
|
|
|
+ values (#{province,jdbcType=INTEGER}, #{depId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR},
|
|
|
+ #{quantity,jdbcType=INTEGER}, #{newUser,jdbcType=INTEGER}, #{total,jdbcType=DECIMAL},
|
|
|
+ #{date,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseCount" useGeneratedKeys="true">
|
|
|
insert into public_release_count
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
+ <if test="province != null">
|
|
|
+ province,
|
|
|
</if>
|
|
|
- <if test="aid != null">
|
|
|
- aid,
|
|
|
+ <if test="depId != null">
|
|
|
+ dep_id,
|
|
|
</if>
|
|
|
- <if test="count != null">
|
|
|
- `count`,
|
|
|
+ <if test="uid != null">
|
|
|
+ `uid`,
|
|
|
</if>
|
|
|
- <if test="hour != null">
|
|
|
- `hour`,
|
|
|
+ <if test="quantity != null">
|
|
|
+ quantity,
|
|
|
</if>
|
|
|
- <if test="noApproved != null">
|
|
|
- no_approved,
|
|
|
+ <if test="newUser != null">
|
|
|
+ new_user,
|
|
|
</if>
|
|
|
- <if test="reject != null">
|
|
|
- reject,
|
|
|
+ <if test="total != null">
|
|
|
+ total,
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time,
|
|
|
+ <if test="date != null">
|
|
|
+ `date`,
|
|
|
</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=INTEGER},
|
|
|
+ <if test="province != null">
|
|
|
+ #{province,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="aid != null">
|
|
|
- #{aid,jdbcType=VARCHAR},
|
|
|
+ <if test="depId != null">
|
|
|
+ #{depId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="count != null">
|
|
|
- #{count,jdbcType=INTEGER},
|
|
|
+ <if test="uid != null">
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="hour != null">
|
|
|
- #{hour,jdbcType=DOUBLE},
|
|
|
+ <if test="quantity != null">
|
|
|
+ #{quantity,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="noApproved != null">
|
|
|
- #{noApproved,jdbcType=INTEGER},
|
|
|
+ <if test="newUser != null">
|
|
|
+ #{newUser,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="reject != null">
|
|
|
- #{reject,jdbcType=INTEGER},
|
|
|
+ <if test="total != null">
|
|
|
+ #{total,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="date != null">
|
|
|
+ #{date,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into public_release_count (province, dep_id, `uid`,
|
|
|
+ quantity, new_user, total,
|
|
|
+ `date`)
|
|
|
+ values
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
+ (#{item.province,jdbcType=INTEGER}, #{item.depId,jdbcType=VARCHAR}, #{item.uid,jdbcType=VARCHAR},
|
|
|
+ #{item.quantity,jdbcType=INTEGER}, #{item.newUser,jdbcType=INTEGER}, #{item.total,jdbcType=DECIMAL},
|
|
|
+ #{item.date,jdbcType=VARCHAR})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
update public_release_count
|
|
|
<set>
|
|
|
- <if test="aid != null">
|
|
|
- aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ <if test="province != null">
|
|
|
+ province = #{province,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="depId != null">
|
|
|
+ dep_id = #{depId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="count != null">
|
|
|
- `count` = #{count,jdbcType=INTEGER},
|
|
|
+ <if test="uid != null">
|
|
|
+ `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="hour != null">
|
|
|
- `hour` = #{hour,jdbcType=DOUBLE},
|
|
|
+ <if test="quantity != null">
|
|
|
+ quantity = #{quantity,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="noApproved != null">
|
|
|
- no_approved = #{noApproved,jdbcType=INTEGER},
|
|
|
+ <if test="newUser != null">
|
|
|
+ new_user = #{newUser,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="reject != null">
|
|
|
- reject = #{reject,jdbcType=INTEGER},
|
|
|
+ <if test="total != null">
|
|
|
+ total = #{total,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="date != null">
|
|
|
+ `date` = #{date,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicReleaseCount">
|
|
|
- <!--
|
|
|
- WARNING - @mbg.generated
|
|
|
- This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Wed Jun 02 11:08:16 CST 2021.
|
|
|
- -->
|
|
|
update public_release_count
|
|
|
- set aid = #{aid,jdbcType=VARCHAR},
|
|
|
- `count` = #{count,jdbcType=INTEGER},
|
|
|
- `hour` = #{hour,jdbcType=DOUBLE},
|
|
|
- no_approved = #{noApproved,jdbcType=INTEGER},
|
|
|
- reject = #{reject,jdbcType=INTEGER},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ set province = #{province,jdbcType=INTEGER},
|
|
|
+ dep_id = #{depId,jdbcType=VARCHAR},
|
|
|
+ `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
+ quantity = #{quantity,jdbcType=INTEGER},
|
|
|
+ new_user = #{newUser,jdbcType=INTEGER},
|
|
|
+ total = #{total,jdbcType=DECIMAL},
|
|
|
+ `date` = #{date,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
-
|
|
|
- <select id="selectByAid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from public_release_count
|
|
|
- where aid = #{aid}
|
|
|
- </select>
|
|
|
</mapper>
|