mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
add 根据memberId查询站点收藏列表方法
This commit is contained in:
@@ -60,4 +60,11 @@ public interface MemberStationRelationMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMemberStationRelationByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 通过memberId查询站点idList
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<String> getStationIdListByMemberId(String memberId);
|
||||
}
|
||||
|
||||
@@ -58,4 +58,11 @@ public interface MemberStationRelationService {
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMemberStationRelationById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过memberId查询站点idList
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
public List<String> getStationIdListByMemberId(String memberId);
|
||||
}
|
||||
|
||||
@@ -87,4 +87,9 @@ public class MemberStationRelationServiceImpl implements MemberStationRelationSe
|
||||
public int deleteMemberStationRelationById(Integer id) {
|
||||
return memberStationRelationMapper.deleteMemberStationRelationById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getStationIdListByMemberId(String memberId) {
|
||||
return memberStationRelationMapper.getStationIdListByMemberId(memberId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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.jsowell.pile.mapper.MemberStationRelationMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.MemberStationRelation" id="MemberStationRelationResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="stationId" column="station_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMemberStationRelationVo">
|
||||
select id, member_id, station_id, create_time, create_by, update_time, update_by from member_station_relation
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, member_id, station_id, create_time, create_by, update_time, update_by
|
||||
</sql>
|
||||
|
||||
<select id="selectMemberStationRelationList" parameterType="com.jsowell.pile.domain.MemberStationRelation" resultMap="MemberStationRelationResult">
|
||||
<include refid="selectMemberStationRelationVo"/>
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="stationId != null "> and station_id = #{stationId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMemberStationRelationById" parameterType="Integer" resultMap="MemberStationRelationResult">
|
||||
<include refid="selectMemberStationRelationVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMemberStationRelation" parameterType="com.jsowell.pile.domain.MemberStationRelation" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into member_station_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="stationId != null">station_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="stationId != null">#{stationId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMemberStationRelation" parameterType="com.jsowell.pile.domain.MemberStationRelation">
|
||||
update member_station_relation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="stationId != null">station_id = #{stationId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMemberStationRelationById" parameterType="Integer">
|
||||
delete from member_station_relation where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMemberStationRelationByIds" parameterType="String">
|
||||
delete from member_station_relation where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getStationIdListByMemberId" resultType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from member_station_relation
|
||||
where member_id = #{memberId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user