SecondhandFlawMapper.xml
1.39 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
<?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.product.dal.SecondhandFlawMapper">
<resultMap id="BaseResultMap" type="com.yoho.product.model.SecondhandFlaw">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="attr" jdbcType="VARCHAR" property="attr" />
<result column="order_by" jdbcType="INTEGER" property="orderBy" />
</resultMap>
<select id="selectByType" resultMap="BaseResultMap">
select id, type, name, attr, order_by
from secondhand_flaw
where type=#{type}
order by order_by
</select>
<select id="selectByIds" resultMap="BaseResultMap">
select * from secondhand_flaw where id in(${ids})
</select>
<select id="selectBatchByIds" resultMap="BaseResultMap">
select id, type, name, attr, order_by
from secondhand_flaw where 1=1
<if test="idList != null and idList.size()>0">
and id in
<foreach collection="idList" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</select>
<select id="selectAllFlaw" resultMap="BaseResultMap">
select id, type, name, attr, order_by
from secondhand_flaw limit 1000
</select>
</mapper>