123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.caimei.modules.bulkpurchase.dao.CmRefundsRecordDao">
-
- <sql id="cmRefundsRecordColumns">
- a.id AS "id",
- a.orderId AS "orderId",
- a.userId AS "userId",
- a.userType AS "userType",
- a.orderType AS "orderType",
- a.recordContent AS "recordContent",
- a.recordDate AS "recordDate"
- </sql>
-
- <sql id="cmRefundsRecordJoins">
- </sql>
-
- <select id="get" resultType="CmRefundsRecord">
- SELECT
- <include refid="cmRefundsRecordColumns"/>
- FROM cm_refunds_record a
- <include refid="cmRefundsRecordJoins"/>
- WHERE a.id = #{id}
- order BY a.recordDate DESC
- </select>
-
- <select id="findList" resultType="CmRefundsRecord">
- SELECT
- <include refid="cmRefundsRecordColumns"/>
- FROM cm_refunds_record a
- <include refid="cmRefundsRecordJoins"/>
- <where>
-
- <if test="userId != null and userId != ''">
- AND a.userId = #{userId}
- </if>
- <if test="orderId != null and orderId != ''">
- AND a.orderId = #{orderId}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- order BY a.recordDate DESC
- </select>
-
- <select id="findAllList" resultType="CmRefundsRecord">
- SELECT
- <include refid="cmRefundsRecordColumns"/>
- FROM cm_refunds_record a
- <include refid="cmRefundsRecordJoins"/>
- <where>
-
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert" parameterType="CmRefundsRecord" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_refunds_record(
- id,
- orderId,
- userId,
- userType,
- orderType,
- recordContent,
- recordDate
- ) VALUES (
- #{id},
- #{orderId},
- #{userId},
- #{userType},
- #{orderType},
- #{recordContent},
- #{recordDate}
- )
- </insert>
-
- <update id="update">
- UPDATE cm_refunds_record SET
- orderId = #{orderId},
- userId = #{userId},
- userType = #{userType},
- orderType = #{orderType},
- recordContent = #{recordContent},
- recordDate = #{recordDate}
- WHERE id = #{id}
- </update>
-
- <delete id="delete">
- DELETE FROM cm_refunds_record
- WHERE id = #{id}
- </delete>
-
- </mapper>
|