SearchAdminMapper.xml 6.17 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.search.dal.SearchAdminMapper">
	<!-- <cache eviction="LRU" type="com.yoho.search.redis.MybatisRedisCache" 
		/> -->
	<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SearchAdmin">
		<id column="id" property="id" jdbcType="BIGINT" />
		<result column="scene_code" property="sceneCode" jdbcType="VARCHAR" />
		<result column="field_name1" property="fieldName1" jdbcType="VARCHAR" />
		<result column="weight1" property="weight1" jdbcType="BIGINT" />
		<result column="field_name2" property="fieldName2" jdbcType="VARCHAR" />
		<result column="weight2" property="weight2" jdbcType="BIGINT" />
		<result column="field_name3" property="fieldName3" jdbcType="VARCHAR" />
		<result column="weight3" property="weight3" jdbcType="BIGINT" />
		<result column="field_name4" property="fieldName4" jdbcType="VARCHAR" />
		<result column="weight4" property="weight4" jdbcType="BIGINT" />
		<result column="field_name5" property="fieldName5" jdbcType="VARCHAR" />
		<result column="weight5" property="weight5" jdbcType="BIGINT" />
	</resultMap>
	<sql id="Base_Column_List">
		id, scene_code, field_name1, weight1, field_name2, weight2, field_name3,
		weight3,
		field_name4, weight4, field_name5, weight5
	</sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
		parameterType="java.lang.Long" timeout="20000">
		select
		<include refid="Base_Column_List" />
		from search_admin
		where id = #{id,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" timeout="20000">
		delete from search_admin
		where id = #{id,jdbcType=BIGINT}
	</delete>
	<insert id="insert" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
		insert ignore into search_admin (id, scene_code, field_name1,
		weight1, field_name2, weight2,
		field_name3, weight3, field_name4,
		weight4, field_name5, weight5
		)
		values (#{id,jdbcType=BIGINT}, #{sceneCode,jdbcType=VARCHAR},
		#{fieldName1,jdbcType=VARCHAR},
		#{weight1,jdbcType=BIGINT}, #{fieldName2,jdbcType=VARCHAR}, #{weight2,jdbcType=BIGINT},
		#{fieldName3,jdbcType=VARCHAR}, #{weight3,jdbcType=BIGINT},
		#{fieldName4,jdbcType=VARCHAR},
		#{weight4,jdbcType=BIGINT}, #{fieldName5,jdbcType=VARCHAR}, #{weight5,jdbcType=BIGINT}
		)
	</insert>
	<insert id="insertSelective" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
		insert ignore into search_admin
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null">
				id,
			</if>
			<if test="sceneCode != null">
				scene_code,
			</if>
			<if test="fieldName1 != null">
				field_name1,
			</if>
			<if test="weight1 != null">
				weight1,
			</if>
			<if test="fieldName2 != null">
				field_name2,
			</if>
			<if test="weight2 != null">
				weight2,
			</if>
			<if test="fieldName3 != null">
				field_name3,
			</if>
			<if test="weight3 != null">
				weight3,
			</if>
			<if test="fieldName4 != null">
				field_name4,
			</if>
			<if test="weight4 != null">
				weight4,
			</if>
			<if test="fieldName5 != null">
				field_name5,
			</if>
			<if test="weight5 != null">
				weight5,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="id != null">
				#{id,jdbcType=BIGINT},
			</if>
			<if test="sceneCode != null">
				#{sceneCode,jdbcType=VARCHAR},
			</if>
			<if test="fieldName1 != null">
				#{fieldName1,jdbcType=VARCHAR},
			</if>
			<if test="weight1 != null">
				#{weight1,jdbcType=BIGINT},
			</if>
			<if test="fieldName2 != null">
				#{fieldName2,jdbcType=VARCHAR},
			</if>
			<if test="weight2 != null">
				#{weight2,jdbcType=BIGINT},
			</if>
			<if test="fieldName3 != null">
				#{fieldName3,jdbcType=VARCHAR},
			</if>
			<if test="weight3 != null">
				#{weight3,jdbcType=BIGINT},
			</if>
			<if test="fieldName4 != null">
				#{fieldName4,jdbcType=VARCHAR},
			</if>
			<if test="weight4 != null">
				#{weight4,jdbcType=BIGINT},
			</if>
			<if test="fieldName5 != null">
				#{fieldName5,jdbcType=VARCHAR},
			</if>
			<if test="weight5 != null">
				#{weight5,jdbcType=BIGINT},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
		update search_admin
		<set>
			<if test="sceneCode != null">
				scene_code = #{sceneCode,jdbcType=VARCHAR},
			</if>
			<if test="fieldName1 != null">
				field_name1 = #{fieldName1,jdbcType=VARCHAR},
			</if>
			<if test="weight1 != null">
				weight1 = #{weight1,jdbcType=BIGINT},
			</if>
			<if test="fieldName2 != null">
				field_name2 = #{fieldName2,jdbcType=VARCHAR},
			</if>
			<if test="weight2 != null">
				weight2 = #{weight2,jdbcType=BIGINT},
			</if>
			<if test="fieldName3 != null">
				field_name3 = #{fieldName3,jdbcType=VARCHAR},
			</if>
			<if test="weight3 != null">
				weight3 = #{weight3,jdbcType=BIGINT},
			</if>
			<if test="fieldName4 != null">
				field_name4 = #{fieldName4,jdbcType=VARCHAR},
			</if>
			<if test="weight4 != null">
				weight4 = #{weight4,jdbcType=BIGINT},
			</if>
			<if test="fieldName5 != null">
				field_name5 = #{fieldName5,jdbcType=VARCHAR},
			</if>
			<if test="weight5 != null">
				weight5 = #{weight5,jdbcType=BIGINT},
			</if>
		</set>
		where id = #{id,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.SearchAdmin" timeout="20000">
		update search_admin
		set scene_code = #{sceneCode,jdbcType=VARCHAR},
		field_name1 = #{fieldName1,jdbcType=VARCHAR},
		weight1 = #{weight1,jdbcType=BIGINT},
		field_name2 = #{fieldName2,jdbcType=VARCHAR},
		weight2 = #{weight2,jdbcType=BIGINT},
		field_name3 = #{fieldName3,jdbcType=VARCHAR},
		weight3 = #{weight3,jdbcType=BIGINT},
		field_name4 = #{fieldName4,jdbcType=VARCHAR},
		weight4 = #{weight4,jdbcType=BIGINT},
		field_name5 = #{fieldName5,jdbcType=VARCHAR},
		weight5 = #{weight5,jdbcType=BIGINT}
		where id = #{id,jdbcType=BIGINT}
	</update>
	<select id="selectBySceneCode" parameterType="java.lang.String"
		resultMap="BaseResultMap" timeout="20000">
		select
		<include refid="Base_Column_List" />
		from search_admin
		where scene_code = #{sceneCode,jdbcType=VARCHAR}
	</select>
</mapper>