<?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.superdesk.uniorder.dao.mapper.sys.SysUserOrderSourcetypeMapper">
	<resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.SysUserOrderSourcetypeKey">
		<id column="user_id" property="userId" jdbcType="BIGINT"/>
		<id column="sourcetype_id" property="sourcetypeId" jdbcType="BIGINT"/>
	</resultMap>
	<delete id="deleteByUserId" parameterType="java.lang.Long">
    delete from sys_user_order_sourcetype
    where user_id = #{_parameter,jdbcType=BIGINT}
      
  </delete>

	<delete id="deleteByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysUserOrderSourcetypeKey">
    delete from sys_user_order_sourcetype
    where user_id = #{userId,jdbcType=BIGINT}
      and sourcetype_id = #{sourcetypeId,jdbcType=BIGINT}
  </delete>
	<insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysUserOrderSourcetypeKey">
    insert into sys_user_order_sourcetype (user_id, sourcetype_id)
    values (#{userId,jdbcType=BIGINT}, #{sourcetypeId,jdbcType=BIGINT})
  </insert>
	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysUserOrderSourcetypeKey">
		insert into sys_user_order_sourcetype
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="userId != null">
				user_id,
			</if>
			<if test="sourcetypeId != null">
				sourcetype_id,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="userId != null">
				#{userId,jdbcType=BIGINT},
			</if>
			<if test="sourcetypeId != null">
				#{sourcetypeId,jdbcType=BIGINT},
			</if>
		</trim>
	</insert>
</mapper>