| 1234567891011121314151617181920212223242526272829303132333435 |
- <?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.sayu.mapper.CallLogMapper">
- <resultMap id="BaseResultMap" type="com.sayu.entity.CallLog">
- <id column="id" property="id"/>
- <result column="caller_identity_id" property="callerIdentityId"/>
- <result column="callee_identity_id" property="calleeIdentityId"/>
- <result column="call_time" property="callTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, caller_identity_id, callee_identity_id, call_time
- </sql>
- <insert id="insert" parameterType="com.sayu.entity.CallLog" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO call_log (caller_identity_id, callee_identity_id, call_time)
- VALUES (#{callerIdentityId}, #{calleeIdentityId}, NOW())
- </insert>
- <select id="selectByCallerIdentityId" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List"/>
- FROM call_log
- WHERE caller_identity_id = #{callerIdentityId}
- ORDER BY call_time DESC
- </select>
- <select id="selectByCalleeIdentityId" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List"/>
- FROM call_log
- WHERE callee_identity_id = #{calleeIdentityId}
- ORDER BY call_time DESC
- </select>
- </mapper>
|