UnionLogsMapper.xml 3.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.yoho.unions.dal.IUnionLogsDAO">
	<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.UnionLogs">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="app_id" property="appId" jdbcType="VARCHAR" />
		<result column="udid" property="udid" jdbcType="VARCHAR" />
		<result column="idfa" property="idfa" jdbcType="VARCHAR" />
		<result column="imei" property="imei" jdbcType="VARCHAR" />
		<result column="is_activate" property="isActivate" jdbcType="TINYINT" />
		<result column="union_type" property="unionType" jdbcType="TINYINT" />
		<result column="add_params" property="addParams" jdbcType="VARCHAR" />
		<result column="activate_params" property="activateParams"
			jdbcType="VARCHAR" />
		<result column="create_time" property="createTime" jdbcType="INTEGER" />
		<result column="update_time" property="updateTime" jdbcType="INTEGER" />
		<result column="client_type" property="clientType" jdbcType="VARCHAR" />
	</resultMap>
	<sql id="Base_Column_List">
		id, app_id, udid, idfa, imei, is_activate, union_type, add_params,
		activate_params,
		create_time, update_time, client_type
	</sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
		parameterType="java.lang.Integer">
		select
		<include refid="Base_Column_List" />
		from union_logs
		where id = #{id,jdbcType=INTEGER}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		delete from union_logs
		where id = #{id,jdbcType=INTEGER}
	</delete>
	<insert id="insert" parameterType="com.yoho.unions.dal.model.UnionLogs">
		insert into union_logs (id, app_id, udid,
		idfa, imei, is_activate,
		union_type, add_params, activate_params,
		create_time, update_time, client_type)
		values (#{id,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR},
		#{udid,jdbcType=VARCHAR},
		#{idfa,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{isActivate,jdbcType=TINYINT},
		#{unionType,jdbcType=TINYINT}, #{addParams,jdbcType=VARCHAR},
		#{activateParams,jdbcType=VARCHAR},
		#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{clientType})
	</insert>
	<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionLogs">
		update union_logs
		set app_id = #{appId,jdbcType=VARCHAR},
		udid = #{udid,jdbcType=VARCHAR},
		idfa = #{idfa,jdbcType=VARCHAR},
		imei = #{imei,jdbcType=VARCHAR},
		is_activate = #{isActivate,jdbcType=TINYINT},
		union_type = #{unionType,jdbcType=TINYINT},
		add_params = #{addParams,jdbcType=VARCHAR},
		activate_params = #{activateParams,jdbcType=VARCHAR},
		create_time = #{createTime,jdbcType=INTEGER},
		update_time = #{updateTime,jdbcType=INTEGER},
		client_type=#{clientType}
		where id = #{id,jdbcType=INTEGER}
	</update>
	<select id="selectIOS" resultMap="BaseResultMap" parameterType="com.yoho.unions.dal.model.UnionLogs">
		select
		<include refid="Base_Column_List" />
		from union_logs
		where app_id = #{appId,jdbcType=VARCHAR} and 
		idfa = #{idfa,jdbcType=VARCHAR} and
		client_type=#{clientType} limit 1
	</select>
	<select id="selectAndroid" resultMap="BaseResultMap" parameterType="com.yoho.unions.dal.model.UnionLogs">
		select
		<include refid="Base_Column_List" />
		from union_logs
		where app_id = #{appId,jdbcType=VARCHAR} and
		imei = #{imei,jdbcType=VARCHAR} and
		client_type=#{clientType} limit 1
	</select>
</mapper>