IMRefundOrderImageMapper.xml 1.4 KB
<?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.sibu.orderHelper.integral.web.dao.IMRefundOrderImageDao">
    <resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMRefundOrderImage">
        <id column="id" jdbcType="VARCHAR" property="id"/>
        <result column="refund_id" jdbcType="VARCHAR" property="refundId"/>
        <result column="url" jdbcType="VARCHAR" property="url"/>
        <result column="sort" jdbcType="INTEGER" property="sort"/>
        <result column="type" jdbcType="TINYINT" property="type"/>
    </resultMap>
    <sql id="Base_Column_List">
      id, refund_id, url, sort, type
   </sql>
    <insert id="insert" parameterType="com.sibu.orderHelper.integral.model.IMRefundOrderImage">
       INSERT INTO `im_refund_order_image`
       (`id`,
       `refund_id`,
       `url`,
       `sort`,
       `type`)
       VALUES
       (#{id},
       #{refundId},
       #{url},
       #{sort},
       #{type});

   </insert>

    <select id="findByRefundIdAndType" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from im_refund_order_image where refund_id = #{refundId} and type = #{type}
    </select>
    <delete id="removeByRefundIdAndType">
        delete from im_refund_order_image where refund_id = #{refundId} and type = #{type}
    </delete>
</mapper>