SknImageVectorsMapper.xml
3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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.SknImageVectorsMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.SknImageVectors">
<id column="product_skn" property="productSkn" jdbcType="INTEGER"/>
<result column="img_url" property="imgUrl" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="vectors_32" property="vectors_32" jdbcType="LONGVARCHAR"/>
<result column="vectors_128" property="vectors_128" jdbcType="LONGVARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
product_skn, img_url, create_time, vectors_32,vectors_128
</sql>
<insert id="insertBatch" parameterType="java.util.List" timeout="20000">
insert ignore into skn_image_vectors (product_skn, img_url, create_time, vectors_32,vectors_128)
values
<foreach collection="list" item="item" index="index"
separator=",">
(#{item.productSkn, jdbcType=INTEGER},
#{item.imgUrl, jdbcType=VARCHAR},
#{item.createTime, jdbcType=INTEGER},
#{item.vectors_32, jdbcType=LONGVARCHAR},
#{item.vectors_128, jdbcType=LONGVARCHAR})
</foreach>
</insert>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from skn_image_vectors
where product_skn = #{productSkn,jdbcType=INTEGER}
limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from skn_image_vectors
where product_skn = #{productSkn,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.SknImageVectors">
insert into skn_image_vectors (product_skn, img_url, create_time,
vectors_32,vectors_128)
values (#{productSkn,jdbcType=INTEGER}, #{imgUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER},
#{vectors_32,jdbcType=LONGVARCHAR},#{vectors_128,jdbcType=LONGVARCHAR})
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.SknImageVectors">
update skn_image_vectors
<set>
<if test="imgUrl != null">
img_url = #{imgUrl,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="vectors_32 != null">
vectors_32 = #{vectors_32,jdbcType=LONGVARCHAR},
</if>
<if test="vectors_128 != null">
vectors_128 = #{vectors_128,jdbcType=LONGVARCHAR},
</if>
</set>
where product_skn = #{productSkn,jdbcType=INTEGER}
</update>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM skn_image_vectors
</select>
<select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from skn_image_vectors limit #{offset},#{pageSize}
</select>
</mapper>