PolicyGoodsGroupMapper.xml 2.32 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.common.mapper.PolicyGoodsGroupMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.PolicyGoodsGroup" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="PLCY_ID" property="plcyId" jdbcType="BIGINT" />
    <result column="PLCY_TYPE" property="plcyType" jdbcType="TINYINT" />
    <result column="GRP_ID" property="grpId" jdbcType="BIGINT" />
  </resultMap>
  <!-- 新增适用的品牌 -->
  <insert id="insetrPolicyGoodsGroup" parameterType="java.util.List">
  	insert into crm_policy_goods_group (`PLCY_ID`, `PLCY_TYPE`, `GRP_ID`)
  	values
  	<foreach collection="list" item="item" index="index" separator=",">
  		(#{item.plcyId,jdbcType=BIGINT},
  			1,
  		 #{item.grpId,jdbcType=BIGINT})
  	</foreach>
  </insert>
  <delete id="delete" parameterType="java.lang.Long">
  	delete from crm_policy_goods_group where PLCY_ID = #{plcyId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_policy_goods_group (`PLCY_ID`, `PLCY_TYPE`, `GRP_ID`
      )
    values (#{plcyId,jdbcType=BIGINT}, 1, 0
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.PolicyGoodsGroup" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into crm_policy_goods_group
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="plcyId != null" >
        `PLCY_ID`,
      </if>
      <if test="plcyType != null" >
        `PLCY_TYPE`,
      </if>
      <if test="grpId != null" >
        `GRP_ID`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="plcyId != null" >
        #{plcyId,jdbcType=BIGINT},
      </if>
      <if test="plcyType != null" >
        #{plcyType,jdbcType=TINYINT},
      </if>
      <if test="grpId != null" >
        #{grpId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
</mapper>