12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?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">
- <!-- 命名,每一个映射对象不一样 namespace:必须与对应的接口全类名一致 -->
- <mapper namespace="com.iamberry.app.mapper.CodeMapper">
-
- <!-- 保存一个发送记录 -->
- <insert id="save" parameterType="CodeValid">
- INSERT INTO
- CODE_VALID
- (
- CODE_PHONE, CODE_VALUE, CODE_SEND_DATE, CODE_VALID_DATE,
- CODE_STATUS, CODE_MSG, CODE_CHANNEL, CODE_USE, CODE_SCENARIO
- )
- VALUES
- (
- #{codePhone}, #{codeValue}, #{codeSendDate}, #{codeValidDate},
- #{codeStatus}, #{codeMsg}, #{codeChannel}, #{codeUse}, #{codeScenario}
- )
- </insert>
-
- <!-- 获取用户最近的记录 -->
- <select id="getLast" parameterType="string" resultType="CodeValid">
- SELECT
- *
- FROM
- CODE_VALID
- WHERE
- CODE_PHONE = #{phone}
- ORDER BY
- CODE_ID DESC
- LIMIT 0, 1
- </select>
-
- <!-- 根据code_id,更新本次记录状态 -->
- <update id="update" parameterType="long">
- UPDATE
- CODE_VALID
- SET
- CODE_USE = 1
- WHERE
- CODE_ID = #{codeID}
- </update>
- </mapper>
|