48 lines
1.9 KiB
XML
48 lines
1.9 KiB
XML
<?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.gameplatform.server.mapper.agent.LinkBatchMapper">
|
|
<resultMap id="LinkBatchMap" type="com.gameplatform.server.model.entity.agent.LinkBatch">
|
|
<id property="id" column="id" />
|
|
<result property="agentId" column="agent_id" />
|
|
<result property="quantity" column="quantity" />
|
|
<result property="times" column="times" />
|
|
<result property="operatorId" column="operator_id" />
|
|
<result property="createdAt" column="created_at" />
|
|
</resultMap>
|
|
|
|
<select id="findById" parameterType="long" resultMap="LinkBatchMap">
|
|
SELECT id, agent_id, quantity, times, operator_id, created_at
|
|
FROM link_batch
|
|
WHERE id = #{id}
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="com.gameplatform.server.model.entity.agent.LinkBatch" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO link_batch (agent_id, quantity, times, operator_id)
|
|
VALUES (#{agentId}, #{quantity}, #{times}, #{operatorId})
|
|
</insert>
|
|
|
|
<select id="findByAgentId" resultMap="LinkBatchMap">
|
|
SELECT id, agent_id, quantity, times, operator_id, created_at
|
|
FROM link_batch
|
|
WHERE agent_id = #{agentId}
|
|
ORDER BY created_at DESC
|
|
LIMIT #{size} OFFSET #{offset}
|
|
</select>
|
|
|
|
<select id="countByAgentId" resultType="long">
|
|
SELECT COUNT(1) FROM link_batch WHERE agent_id = #{agentId}
|
|
</select>
|
|
|
|
<select id="findAll" resultMap="LinkBatchMap">
|
|
SELECT id, agent_id, quantity, times, operator_id, created_at
|
|
FROM link_batch
|
|
ORDER BY created_at DESC
|
|
LIMIT #{size} OFFSET #{offset}
|
|
</select>
|
|
|
|
<select id="countAll" resultType="long">
|
|
SELECT COUNT(1) FROM link_batch
|
|
</select>
|
|
</mapper>
|