45 lines
1.7 KiB
XML
Raw Permalink Normal View History

2026-03-10 14:30:24 +08:00
<?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="PointLog">
<insert id="insertPointLog" parameterType="PointLog">
INSERT INTO PointLog ( pointLogId, uid, pointCaseType, objectId,
pointCaseId, point, created , areaid )
Values ( #{pointLogId}, #{uid}, #{pointCaseType}, #{objectId},
#{pointCaseId}, #{point},current_timestamp , #{areaid} )
</insert>
<update id="updatePointLog" parameterType="PointLog">
UPDATE PointLog
SET pointLogId = #{pointLogId}, uid = #{uid},
pointCaseType = #{pointCaseType}, objectId = #{objectId},
pointCaseId = #{pointCaseId}, point = #{point},
created = #{created} , areaid = #{areaid}
where pointLogId=#{pointLogId}
</update>
<select id="getPointLogByKey" parameterType="java.lang.Integer" resultType="PointLog">
SELECT pointLogId , uid , pointCaseType , objectId , pointCaseId ,
point , created , areaid
FROM PointLog WHERE pointLogId=#{pointLogId}
</select>
<select id="getSeqPointLog" resultType="Long" useCache="false" flushCache="true">
SELECT nextval('seq_pointLogId') ;
</select>
<select id="getPointLogsByUid" parameterType="java.util.Map" resultType="PointLog">
SELECT pointLogId , uid , pointCaseType , objectId , pointCaseId ,
point , created , areaid
FROM PointLog
WHERE uid=#{uid} and areaid = #{areaid}
</select>
<select id="getTotalPointByUid" resultType="Integer">
SELECT sum( point )
FROM PointLog
WHERE uid=#{uid} and areaid = #{areaid}
</select>
</mapper>