OrderPointsMapper.xml 3.77 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="cn.runsa.crmapp.points.mapper.OrderPointsMapper">
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.OrderPoints">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="RCPT_ID" jdbcType="VARCHAR" property="rcptId" />
    <result column="BLC_ACT" jdbcType="BIGINT" property="blcAct" />
    <result column="ACT_ID" jdbcType="BIGINT" property="actId" />
    <result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
    <result column="PNT_VAL" jdbcType="DOUBLE" property="pntVal" />
  </resultMap>
  <resultMap id="PointsMap" type="cn.runsa.crmapp.points.entity.support.Points">
    <result column="BLC_ACT" jdbcType="BIGINT" property="blcAct" />
    <result column="ACT_ID" jdbcType="BIGINT" property="actId" />
    <result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
    <result column="PNT_VAL" jdbcType="DOUBLE" property="pntVal" />
  </resultMap>
  <insert id="insert" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_order_points (`RCPT_ID`, `BLC_ACT`, `ACT_ID`, 
      `PNT_TYPE`, `PNT_VAL`)
    values (#{rcptId,jdbcType=VARCHAR}, #{blcAct,jdbcType=BIGINT}, #{actId,jdbcType=BIGINT}, 
      #{pntType,jdbcType=VARCHAR}, #{pntVal,jdbcType=DOUBLE})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_order_points
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="rcptId != null">
        `RCPT_ID`,
      </if>
      <if test="blcAct != null">
        `BLC_ACT`,
      </if>
      <if test="actId != null">
        `ACT_ID`,
      </if>
      <if test="pntType != null">
        `PNT_TYPE`,
      </if>
      <if test="pntVal != null">
        `PNT_VAL`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="rcptId != null">
        #{rcptId,jdbcType=VARCHAR},
      </if>
      <if test="blcAct != null">
        #{blcAct,jdbcType=BIGINT},
      </if>
      <if test="actId != null">
        #{actId,jdbcType=BIGINT},
      </if>
      <if test="pntType != null">
        #{pntType,jdbcType=VARCHAR},
      </if>
      <if test="pntVal != null">
        #{pntVal,jdbcType=DOUBLE},
      </if>
    </trim>
  </insert>
  <insert id="insertList" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
  	 insert into crm_order_points (`RCPT_ID`, `BLC_ACT`, `ACT_ID`,`PNT_TYPE`, `PNT_VAL`)
  	 values 
  	 <foreach collection="list" item="it" separator=",">
  	 	(#{it.rcptId,jdbcType=VARCHAR}, #{it.blcAct,jdbcType=BIGINT}, #{it.actId,jdbcType=BIGINT}, 
      	#{it.pntType,jdbcType=VARCHAR}, #{it.pntVal,jdbcType=DOUBLE})
  	 </foreach>
  </insert>
  <select id="selectPointsList" parameterType="java.lang.String" resultMap="PointsMap">
  	 select `BLC_ACT`, `ACT_ID`,`PNT_TYPE`, `PNT_VAL` from crm_order_points where RCPT_ID = #{id}
  </select>
  <select id="selectOrderPointsList" parameterType="java.lang.String" resultType="map">
  	 SELECT o.*,s.`ACT_NAME`,t.`PNT_NAME` 
  	 FROM crm_order_points o 
  	 LEFT JOIN crm_account_set s 
  	 ON o.`ACT_ID` = s.`ACT_ID` 
  	 LEFT JOIN crm_points_type t 
  	 ON o.`PNT_TYPE` = t.`PNT_TYPE` 
  	 WHERE RCPT_ID = #{id};
  </select>
  <delete id="deleteByReceiptId" parameterType="java.lang.String">
  	DELETE FROM crm_order_points WHERE RCPT_ID = #{id}
  </delete>
</mapper>