|
@@ -0,0 +1,166 @@
|
|
|
|
+<?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.ruoyi.system.mapper.ZbGcMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="ZbGc" id="ZbGcResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="title" column="title" />
|
|
|
|
+ <result property="addr" column="addr" />
|
|
|
|
+ <result property="rule" column="rule" />
|
|
|
|
+ <result property="time" column="time" />
|
|
|
|
+ <result property="other" column="other" />
|
|
|
|
+ <result property="type" column="type" />
|
|
|
|
+ <result property="url" column="url" />
|
|
|
|
+ <result property="searchKey" column="search_key" />
|
|
|
|
+ <result property="depType" column="dep_type" />
|
|
|
|
+ <result property="dep" column="dep" />
|
|
|
|
+ <result property="price" column="price" />
|
|
|
|
+ <result property="word" column="word" />
|
|
|
|
+ <result property="regex" column="regex" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectZbGcVo">
|
|
|
|
+ select id, title, addr, rule, time, other, type, url, search_key, dep_type, dep, price, word, regex from zb_gc
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectZbGcList" parameterType="ZbGc" resultMap="ZbGcResult">
|
|
|
|
+ <include refid="selectZbGcVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
+ <if test="addr != null and addr != ''"> and addr = #{addr}</if>
|
|
|
|
+ <if test="rule != null and rule != ''"> and rule = #{rule}</if>
|
|
|
|
+ <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and time between #{params.beginTime} and #{params.endTime}</if>
|
|
|
|
+ <if test="other != null and other != ''"> and other = #{other}</if>
|
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
+ <if test="url != null and url != ''"> and url = #{url}</if>
|
|
|
|
+ <if test="searchKey != null and searchKey != ''"> and search_key = #{searchKey}</if>
|
|
|
|
+ <if test="depType != null "> and dep_type = #{depType}</if>
|
|
|
|
+ <if test="dep != null and dep != ''"> and dep = #{dep}</if>
|
|
|
|
+ <if test="price != null "> and price = #{price}</if>
|
|
|
|
+ <if test="word != null and word != ''"> and word like concat('%', #{word}, '%')</if>
|
|
|
|
+ <if test="regex != null "> and regex = #{regex}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllCount" resultType="Integer" >
|
|
|
|
+ SELECT count(id) as 'count' FROM zb_gc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllIsNull" resultType="Integer">
|
|
|
|
+ SELECT count(id) as 'count' FROM zb_gc WHERE regex=-1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllNotDoneByType" resultType="Map">
|
|
|
|
+ SELECT type,count(id) as 'count' FROM zb_gc WHERE regex is not null and regex =-1 GROUP BY type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllDoneByType" resultType="Map">
|
|
|
|
+ SELECT type,count(id) as 'count' FROM zb_gc WHERE regex is not null GROUP BY type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllSumPrice" resultType="BigDecimal">
|
|
|
|
+ SELECT sum(price) as 'sum' FROM zb_gc WHERE regex =1 and type='中标结果公示'
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllCountJGByMon" resultType="Map">
|
|
|
|
+ select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='中标结果公示' and time>'2021-06' group by DATE_FORMAT(time,'%Y-%m')
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllCountGGByMon" resultType="Map">
|
|
|
|
+ select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' group by DATE_FORMAT(time,'%Y-%m')
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="selectAllSumPriceByMon" resultType="map">
|
|
|
|
+ select DATE_FORMAT(time,'%Y-%m') as 'mon',COALESCE(sum(price),0) as 'price' from zb_gc WHERE regex =1 and type='中标结果公示' group by DATE_FORMAT(time,'%Y-%m')
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllJGCountByDep" resultType="Map">
|
|
|
|
+ SELECT dep_type,count(id) as 'count' FROM zb_gc WHERE regex=1 and type='中标结果公示' GROUP BY dep_type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllZBCountByDep" resultType="map">
|
|
|
|
+ SELECT dep_type,count(id) as 'count' FROM zb_gc WHERE regex=1 and type='招标公告' GROUP BY dep_type
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllZBCountByDepDateOne" resultType="map">
|
|
|
|
+ select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=1 group by DATE_FORMAT(time,'%Y-%m')
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectAllZBCountByDepDateTwo" resultType="map">
|
|
|
|
+ select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=2 group by DATE_FORMAT(time,'%Y-%m')
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectZbGcById" parameterType="Long" resultMap="ZbGcResult">
|
|
|
|
+ <include refid="selectZbGcVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertZbGc" parameterType="ZbGc" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into zb_gc
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="title != null">title,</if>
|
|
|
|
+ <if test="addr != null">addr,</if>
|
|
|
|
+ <if test="rule != null">rule,</if>
|
|
|
|
+ <if test="time != null">time,</if>
|
|
|
|
+ <if test="other != null">other,</if>
|
|
|
|
+ <if test="type != null">type,</if>
|
|
|
|
+ <if test="url != null">url,</if>
|
|
|
|
+ <if test="searchKey != null">search_key,</if>
|
|
|
|
+ <if test="depType != null">dep_type,</if>
|
|
|
|
+ <if test="dep != null">dep,</if>
|
|
|
|
+ <if test="price != null">price,</if>
|
|
|
|
+ <if test="word != null">word,</if>
|
|
|
|
+ <if test="regex != null">regex,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="title != null">#{title},</if>
|
|
|
|
+ <if test="addr != null">#{addr},</if>
|
|
|
|
+ <if test="rule != null">#{rule},</if>
|
|
|
|
+ <if test="time != null">#{time},</if>
|
|
|
|
+ <if test="other != null">#{other},</if>
|
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
|
+ <if test="url != null">#{url},</if>
|
|
|
|
+ <if test="searchKey != null">#{searchKey},</if>
|
|
|
|
+ <if test="depType != null">#{depType},</if>
|
|
|
|
+ <if test="dep != null">#{dep},</if>
|
|
|
|
+ <if test="price != null">#{price},</if>
|
|
|
|
+ <if test="word != null">#{word},</if>
|
|
|
|
+ <if test="regex != null">#{regex},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateZbGc" parameterType="ZbGc">
|
|
|
|
+ update zb_gc
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="title != null">title = #{title},</if>
|
|
|
|
+ <if test="addr != null">addr = #{addr},</if>
|
|
|
|
+ <if test="rule != null">rule = #{rule},</if>
|
|
|
|
+ <if test="time != null">time = #{time},</if>
|
|
|
|
+ <if test="other != null">other = #{other},</if>
|
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
|
+ <if test="url != null">url = #{url},</if>
|
|
|
|
+ <if test="searchKey != null">search_key = #{searchKey},</if>
|
|
|
|
+ <if test="depType != null">dep_type = #{depType},</if>
|
|
|
|
+ <if test="dep != null">dep = #{dep},</if>
|
|
|
|
+ <if test="price != null">price = #{price},</if>
|
|
|
|
+ <if test="word != null">word = #{word},</if>
|
|
|
|
+ <if test="regex != null">regex = #{regex},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteZbGcById" parameterType="Long">
|
|
|
|
+ delete from zb_gc where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteZbGcByIds" parameterType="String">
|
|
|
|
+ delete from zb_gc where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|