IMSupplierMapper.xml
1.7 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
<?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.sibu.orderHelper.integral.dao.IMSupplierDao">
<select id="findByProductId" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT spl.* FROM im_supplier spl left join im_product_supplier ips on spl.id=ips.supplier_id
where ips.product_id=#{productId}
limit 1
</select>
<select id="findByProductIdIn" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT spl.* FROM im_supplier spl left join im_product_supplier ips on spl.id=ips.supplier_id
where ips.product_id in
<foreach collection="productIds" item="productId" open="(" close=")" separator=",">
#{productId}
</foreach>
</select>
<select id="findByIdIn" resultMap="BaseResultMap" parameterType="java.util.Map">
SELECT
*
FROM im_supplier
where id in
<foreach collection="supplierIds" item="supplierId" open="(" close=")" separator=",">
#{supplierId}
</foreach>
</select>
<resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMSupplier">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="contact" property="contact" />
<result column="contact_phone" property="contactPhone" />
<result column="create_dt" property="createDt"/>
<result column="erp_card_code" property="erpCardCode" />
<result column="sort_name" property="sortName" />
<result column="freight_remark" property="freightRemark"/>
<result column="head_img" property="headImg"/>
<result column="platform_type" property="platformType"/>
</resultMap>
</mapper>