<?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_community.dao.VolunteerIntegralRecordDao">
|
|
<resultMap type="com.panzhihua.service_community.entity.VolunteerIntegralRecord" id="VolunteerIntegralRecordMap">
|
<result property="id" column="id" />
|
<result property="iType" column="i_type" />
|
<result property="creationTime" column="creation_time" />
|
<result property="integral" column="integral" />
|
<result property="volunteerId" column="volunteer_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="userId" column="user_id" />
|
<result property="communityId" column="community_id" />
|
|
</resultMap>
|
|
<!--查询单个-->
|
<select id="getId" resultMap="VolunteerIntegralRecordMap">
|
select
|
id,
|
i_type,
|
creation_time,
|
integral,
|
update_time,
|
user_id,
|
community_id,
|
volunteer_id
|
from volunteer_integral_record
|
where id= #{id}
|
</select>
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="VolunteerIntegralRecordMap">
|
select
|
id,
|
i_type,
|
creation_time,
|
update_time,
|
integral,
|
user_id,
|
community_id,
|
volunteer_id
|
from volunteer_integral_record
|
<where>
|
<if test="userId!=null">
|
user_id=#{userId}
|
</if>
|
<if test="communityId!=null">
|
community_id=#{communityId}
|
</if>
|
</where>
|
order by creation_time desc
|
</select>
|
|
<insert id="insertVolunteer">
|
insert into volunteer_integral_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="volunteerIntegralRecordVO.id != null">
|
id,
|
</if>
|
<if test="volunteerIntegralRecordVO.iType != null">
|
i_type,
|
</if>
|
<if test="volunteerIntegralRecordVO.integral != null">
|
integral,
|
</if>
|
<if test="volunteerIntegralRecordVO.volunteerId != null">
|
volunteer_id,
|
</if>
|
<if test="volunteerIntegralRecordVO.communityId != null">
|
community_id,
|
</if>
|
<if test="volunteerIntegralRecordVO.userId != null">
|
user_id,
|
</if>
|
creation_time
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="volunteerIntegralRecordVO.id != null">
|
#{volunteerIntegralRecordVO.id},
|
</if>
|
<if test="volunteerIntegralRecordVO.iType != null">
|
#{volunteerIntegralRecordVO.iType},
|
</if>
|
<if test="volunteerIntegralRecordVO.integral != null">
|
#{volunteerIntegralRecordVO.integral},
|
</if>
|
<if test="volunteerIntegralRecordVO.volunteerId != null">
|
#{volunteerIntegralRecordVO.volunteerId},
|
</if>
|
<if test="volunteerIntegralRecordVO.communityId != null">
|
#{volunteerIntegralRecordVO.communityId},
|
</if>
|
<if test="volunteerIntegralRecordVO.userId != null">
|
#{volunteerIntegralRecordVO.userId},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="updateId">
|
update volunteer_integral_record
|
<set>
|
<if test="volunteerIntegralRecordVO.id != null">
|
id=#{volunteerIntegralRecordVO.id},
|
</if>
|
<if test="volunteerIntegralRecordVO.iType != null">
|
i_type=#{volunteerIntegralRecordVO.iType},
|
</if>
|
<if test="volunteerIntegralRecordVO.integral != null">
|
integral=#{volunteerIntegralRecordVO.integral},
|
</if>
|
<if test="volunteerIntegralRecordVO.volunteerId != null">
|
volunteer_id=#{volunteerIntegralRecordVO.volunteerId},
|
</if>
|
<if test="volunteerIntegralRecordVO.communityId != null">
|
community_id=#{volunteerIntegralRecordVO.communityId},
|
</if>
|
<if test="volunteerIntegralRecordVO.userId != null">
|
user_id=#{volunteerIntegralRecordVO.userId},
|
</if>
|
update_time=sysdate()
|
</set>
|
where id = #{volunteerIntegralRecordVO.id}
|
|
</update>
|
|
|
<delete id="deleteId" parameterType="String">
|
delete from volunteer_integral_record where id=#{id}
|
</delete>
|
|
|
|
</mapper>
|