<?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.JinhuiReseauPeopleDao">
|
|
<resultMap type="com.panzhihua.service_jinhui_community.entity.JinhuiReseauPeople" id="itemMap">
|
<result property="id" column="id" />
|
<result property="userId" column="user_id" />
|
<result property="reseauName" column="reseau_name" />
|
<result property="reseauIds" column="reseau_ids" />
|
<result property="phone" column="phone" />
|
<result property="creationTime" column="creation_time" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="itemMap">
|
select
|
id,
|
reseau_name,
|
reseau_ids,
|
phone,
|
creation_time,
|
update_time,
|
user_id
|
from jinhui_reseau_people
|
order by creation_time desc
|
</select>
|
|
|
<select id="getDetails" resultMap="itemMap">
|
select
|
id,
|
reseau_name,
|
reseau_ids,
|
phone,
|
creation_time,
|
update_time,
|
user_id
|
from jinhui_reseau_people
|
where
|
id=#{id}
|
</select>
|
|
<insert id="addData">
|
insert into jinhui_reseau_people
|
<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.reseauName != null and item.reseauName != '' ">
|
reseau_name,
|
</if>
|
|
<if test="item.reseauIds != null and item.reseauIds != '' ">
|
reseau_ids,
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
phone,
|
</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.reseauName != null and item.reseauName != '' ">
|
#{item.reseauName},
|
</if>
|
<if test="item.reseauIds != null and item.reseauIds != '' ">
|
#{item.reseauIds},
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
#{item.phone},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="editData">
|
update jinhui_reseau_people
|
<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.reseauName != null and item.reseauName != '' ">
|
reseau_name=#{item.reseauName},
|
</if>
|
<if test="item.reseauIds != null and item.reseauIds != '' ">
|
reseau_ids=#{item.reseauIds},
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
phone=#{item.phone},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<delete id="expurgateData" parameterType="String">
|
delete from jinhui_reseau_people where id=#{id}
|
</delete>
|
|
|
<select id="getUserList" resultType="com.panzhihua.common.model.vos.LoginUserInfoVO">
|
select
|
user_id,
|
phone,
|
nick_name,
|
`name`,
|
community_id,
|
sex,
|
id_card,
|
birthday,
|
image_url,
|
`type`,
|
job,
|
status
|
from sys_user
|
<where>
|
community_id=#{communityId} and status=1
|
<if test="nameAndPhone !=null and nameAndPhone!='' ">
|
and `name` LIKE CONCAT('%', #{nameAndPhone}, '%')
|
or nick_name LIKE CONCAT('%', #{nameAndPhone}, '%')
|
or phone LIKE CONCAT('%', #{nameAndPhone}, '%')
|
</if>
|
</where>
|
|
|
</select>
|
|
|
|
</mapper>
|