123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <?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.example.nngkxxdp.dao.MapDataDao">
- <!--修改一条数据-->
- <update id="updataByid">
- UPDATE s_map
- <trim prefix="set" suffixOverrides=",">
- <if test="maData.dictType !=null">
- dict_type=#{maData.dictType},
- </if>
- <if test="maData.address !=null">
- address=#{maData.address},
- </if>
- <if test="maData.content !=null">
- content=#{maData.content},
- </if>
- <if test="maData.dep !=null">
- dep=#{maData.dep},
- </if>
- <if test="maData.img !=null">
- img=#{maData.img},
- </if>
- <if test="maData.gzh !=null">
- gzh=#{maData.gzh},
- </if>
- <if test="maData.sptype !=null">
- sptype=#{maData.sptype},
- </if>
- <if test="maData.tel !=null">
- tel=#{maData.tel},
- </if>
- <if test="maData.time !=null">
- time=#{maData.time},
- </if>
- </trim>
- where id=#{maData.id}
- </update>
-
- <!--删除一条数据-->
- <delete id="delBymMapId">
- delete
- from s_map
- where id = #{id}
- </delete>
- <!--根据地址 类型 查需要更新或删除id-->
- <select id="sleMapId" resultType="java.lang.Integer">
- SELECT id FROM s_map
- <where>
- <if test="dicType !=null and dicType !=''">
- and dict_type=#{dicType}
- </if>
- <if test="address !=null and address !=''">
- and address=#{address}
- </if>
- <if test="sptype !=null and sptype !=''">
- and sptype=#{sptype}
- </if>
- </where>
- </select>
- <!--分页模糊查询-->
- <select id="selByMapData" resultType="java.util.Map">
- SELECT dict_type,
- address,
- dep,
- img,
- gzh,
- specialtype,
- tel,
- time,
- create_time,
- update_time
- FROM s_map
- <where>
- <if test="dictType !=null and dictType !=''" >
- and dict_type like CONCAT('%', #{dictType}, '%')
- </if>
- <if test="address !=null and address !=''" >
- and address like CONCAT('%', #{address}, '%')
- </if>
- <if test="dep !=null and dep !=''">
- and dep like CONCAT('%', #{dep}, '%')
- </if>
- </where>
- ORDER BY update_time DESC
- LIMIT #{page},#{count}
- </select>
- <sql id="all_base_data">
- id
- , dict_type, address, content, dep, img, gzh, sptype, tel,
- time, url, type, tag, tag2, tag3, specialtype, create_time,
- update_time
- </sql>
- <!-- 批量保存地图数据 -->
- <insert id="insertBatch" parameterType="java.util.List">
- INSERT INTO s_map (
- <include refid="all_base_data"/>
- )
- VALUES
- <foreach collection="mapDataList" item="map" separator=",">
- (NULL,
- #{map.dictType}, #{map.address}, #{map.content}, #{map.dep},
- #{map.img}, #{map.gzh}, #{map.sptype}, #{map.tel}, #{map.time}, #{map.url},
- #{map.type}, #{map.tag}, #{map.tag2}, #{map.tag3},
- #{map.specialtype}, NOW(), NOW())
- </foreach>
- </insert>
- <!-- 清空表数据信息 -->
- <update id="clearMapData">
- TRUNCATE TABLE s_map
- </update>
- <!-- 删除对应ID的地图纠错信息-->
- <delete id="deleteErrorLog">
- delete
- from s_map_errorlog
- where id = #{id}
- </delete>
- <!-- 根据数据字典类型获取地图数据 -->
- <select id="getMapDataByDictType"
- resultType="com.example.nngkxxdp.entity.MapData">
- SELECT
- <include refid="all_base_data"/>
- FROM s_map
- WHERE dict_type = #{dictType}
- </select>
- <!-- 根据地图数据所有的字典类型 -->
- <select id="getDictType" resultType="java.lang.String">
- SELECT dict_type
- FROM s_map
- </select>
- <!-- 根据地图数据所有的字典类型 -->
- <insert id="saveErrorLog" parameterType="map">
- INSERT INTO s_map_errorlog
- (s_map_id, address_name, original_address,
- original_longitude, original_latitude, original_phone, original_office_hours,
- new_phone, new_office_hours, new_address,
- new_longitude, new_latitude, error_state, create_time)
- VALUE
- (#{sMapId},#{addressName},#{originalAddress},
- #{originalLongitude},#{originalLatitude},#{originalPhone},#{originalOfficeHours},#{newPhone},#{newOfficeHours},
- #{newAddress},#{newLongitude},#{newLatitude},#{errorState},#{createTime})
- </insert>
- <select id="getHandMatterCount" resultType="java.lang.Integer">
- select count(*)
- from t_handling_matters
- <where>
- type=#{type}
- <if test="itemName != null">
- AND item_name LIKE CONCAT('%', #{itemName}, '%')
- </if>
- <if test="matterDept != null">
- AND matter_dept LIKE CONCAT('%', #{matterDept}, '%')
- </if>
- </where>
- </select>
- <select id="getHandMatterPage" resultType="java.util.Map">
- SELECT id,
- type,
- item_name,
- matter_dept,
- matter_url
- FROM t_handling_matters
- <where>
- type=#{type}
- <if test="itemName != null">
- AND item_name LIKE CONCAT('%', #{itemName}, '%')
- </if>
- <if test="matterDept != null">
- AND matter_dept LIKE CONCAT('%', #{matterDept}, '%')
- </if>
- </where>
- order by id DESC
- limit #{startRows},#{rows}
- </select>
- <select id="getMapErrorCount" resultType="java.lang.Integer">
- select count(*)
- from s_map_errorlog
- </select>
- <select id="getMapErrorPage" resultType="java.util.Map">
- SELECT sme.id,
- sme.original_address,
- sme.original_longitude,
- sme.original_latitude,
- sme.original_office_hours,
- sme.original_phone,
- sme.new_address,
- sme.new_longitude,
- sme.new_latitude,
- sme.new_office_hours,
- sme.new_phone,
- sme.create_time,
- sme.update_time,
- sm.dep name,
- sm.dict_type,
- sm.content
- FROM s_map_errorlog sme
- left join s_map sm on sm.id = sme.s_map_id
- order by sme.create_time DESC
- limit #{startRows}, #{rows}
- </select>
- <select id="queryMap" resultType="java.util.Map">
- select address,
- ifnull(longitude, '') longitude,
- ifnull(latitude, '') latitude,
- dep name,
- IF(dict_type = 'xxs', type, dict_type) dictType
- from s_map
- <where>
- <if test="null != name and '' != name">
- and dep LIKE CONCAT('%', #{name}, '%')
- </if>
- <if test="null != type and '' != type">
- and dict_type = #{type}
- </if>
- <if test="null != dictType and '' != dictType">
- and type = #{dictType}
- </if>
- </where>
- order by create_time desc
- </select>
- <update id="longitudeLatitude">
- UPDATE s_map
- SET longitude = #{longitude},
- latitude = #{latitude}
- WHERE id = #{id};
- </update>
- <update id="updateErrorLog">
- UPDATE s_map_errorlog
- SET new_address = #{newAddress},
- new_longitude = #{newLongitude},
- new_latitude = #{newLatitude},
- error_state = #{errorState},
- update_time = #{updateTime}
- WHERE id = #{id};
- </update>
- <select id="queryMapPage" resultType="com.example.nngkxxdp.entity.MapDo">
- SELECT
- id,
- dict_type,
- address,
- content,
- dep,
- img,
- gzh,
- sptype,
- tel,
- time,
- url,
- type,
- tag,
- tag2,
- tag3,
- specialtype,
- create_time,
- update_time,
- longitude,
- latitude
- FROM
- s_map
- <where>
- <if test="mapVo.nameOfOrganization!=null and mapVo.nameOfOrganization != ''">
- dep LIKE CONCAT('%',#{mapVo.nameOfOrganization},'%')
- </if>
- <if test="mapVo.serviceType!=null and mapVo.serviceType != ''">
- and sptype LIKE CONCAT('%',#{mapVo.serviceType},'%')
- </if>
- <if test="mapVo.dictType!=null and mapVo.dictType != ''">
- and dict_type = #{mapVo.dictType}
- </if>
- </where>
- order by create_time desc
- limit #{page},#{size}
- </select>
- <select id="pageCount" resultType="long">
- select count(*) from s_map
- <where>
- <if test="mapVo.nameOfOrganization!=null and mapVo.nameOfOrganization != ''">
- and dep LIKE CONCAT('%',#{mapVo.nameOfOrganization},'%')
- </if>
- <if test="mapVo.serviceType!=null and mapVo.serviceType != ''">
- and sptype LIKE CONCAT('%',#{mapVo.serviceType},'%')
- </if>
- <if test="mapVo.dictType!=null and mapVo.dictType != ''">
- and dict_type = #{mapVo.dictType}
- </if>
- </where>
- </select>
- <select id="getMapDataType" resultType="com.example.nngkxxdp.entity.MapData">
- SELECT
- <include refid="all_base_data"/>
- FROM s_map
- <where>
- <if test="dictType!=null and dictType!=''">
- and dict_type in
- <foreach collection="dictType" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="type!=null and type!=''">
- and type = #{type}
- </if>
- <if test="title!=null and title!=''">
- and dep like CONCAT('%',#{title},'%')
- </if>
- </where>
- </select>
- </mapper>
|