<?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.panzhihua.service_jinhui_community.dao.JinhuiSnapshotDao">
|
|
<resultMap type="com.panzhihua.service_jinhui_community.entity.JinhuiSnapshot" id="itemMap">
|
<result property="id" column="id" />
|
<result property="userId" column="user_id" />
|
<result property="reseauId" column="reseau_id" />
|
<result property="content" column="content" />
|
<result property="imgUrl" column="img_url" />
|
<result property="address" column="address" />
|
<result property="lat" column="lat" />
|
<result property="lon" column="lon" />
|
<result property="addressRemark" column="address_remark" />
|
<result property="classifyId" column="classify_id" />
|
<result property="isApply" column="is_apply" />
|
<result property="creationTime" column="creation_time" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="itemMap">
|
select
|
id,
|
user_id,
|
reseau_id,
|
content,
|
img_url,
|
address,
|
lat,
|
lon,
|
address_remark,
|
classify_id,
|
(select classify_name from jinhui_snapshot_classify where jinhui_snapshot_classify.id=jinhui_snapshot.classify_id) as classifyName,
|
creation_time,
|
update_time,
|
is_apply
|
from jinhui_snapshot
|
order by creation_time desc
|
</select>
|
|
|
<select id="getDetails" resultMap="itemMap">
|
select
|
id,
|
user_id,
|
reseau_id,
|
content,
|
img_url,
|
address,
|
lat,
|
lon,
|
address_remark,
|
classify_id,
|
(select classify_name from jinhui_snapshot_classify where jinhui_snapshot_classify.id=jinhui_snapshot.classify_id) as classifyName,
|
creation_time,
|
update_time,
|
is_apply
|
from jinhui_snapshot
|
where
|
id=#{id}
|
</select>
|
|
<insert id="addData">
|
insert into jinhui_snapshot
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
id,
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
user_id,
|
</if>
|
<if test="item.reseauId != null and item.reseauId != '' ">
|
reseau_id,
|
</if>
|
<if test="item.content != null and item.content != '' ">
|
content,
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
img_url,
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
address,
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
lat,
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
lon,
|
</if>
|
<if test="item.addressRemark != null and item.addressRemark != '' ">
|
address_remark,
|
</if>
|
<if test="item.classifyId != null and item.classifyId != '' ">
|
classify_id,
|
</if>
|
<if test="item.isApply != null and item.isApply != '' ">
|
is_apply,
|
</if>
|
creation_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
#{item.id},
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
#{item.userId},
|
</if>
|
<if test="item.reseauId != null and item.reseauId != '' ">
|
#{item.reseauId},
|
</if>
|
<if test="item.content != null and item.content != '' ">
|
#{item.content},
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
#{item.imgUrl},
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
#{item.address},
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
#{item.lat},
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
#{item.lon},
|
</if>
|
<if test="item.addressRemark != null and item.addressRemark != '' ">
|
#{item.addressRemark},
|
</if>
|
<if test="item.classifyId != null and item.classifyId != '' ">
|
#{item.classifyId},
|
</if>
|
<if test="item.isApply != null and item.isApply != '' ">
|
#{item.isApply},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="editData">
|
update jinhui_snapshot
|
<set>
|
<if test="item.id != null and item.id != '' ">
|
id=#{item.id},
|
</if>
|
<if test="item.userId != null and item.userId != '' ">
|
user_id=#{item.userId},
|
</if>
|
<if test="item.reseauId != null and item.reseauId != '' ">
|
reseau_id=#{item.reseauId},
|
</if>
|
<if test="item.content != null and item.content != '' ">
|
content=#{item.content},
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
img_url=#{item.imgUrl},
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
address=#{item.address},
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
lat=#{item.lat},
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
lon=#{item.lon},
|
</if>
|
<if test="item.addressRemark != null and item.addressRemark != '' ">
|
address_remark=#{item.addressRemark},
|
</if>
|
<if test="item.classifyId != null and item.classifyId != '' ">
|
classify_id=#{item.classifyId},
|
</if>
|
<if test="item.isApply != null and item.isApply != '' ">
|
is_apply=#{item.isApply},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<delete id="expurgateData" parameterType="String">
|
delete from jinhui_snapshot where id=#{id}
|
</delete>
|
|
</mapper>
|