guoyujie
5 天以前 1750abd11320f8d09ffe1580b7467dba87c86c89
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
<?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.example.erp.mapper.sd.ProductDetailMapper">
    <select id="getGlassDetailList">
        select * from product_detail where prod_id = #{productId} and detail_type = 'glass'
    </select>
    
    <insert id="insertList">
        insert into product_detail (
            prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation
        )
        values
        <foreach collection ="getProductDetails" item="ProductDetail" separator =",">
            (
                #{ProductDetail.prodId},
                #{ProductDetail.sortNum},
                #{ProductDetail.glassSort},
                #{ProductDetail.detailType},
                #{ProductDetail.detail},
                #{ProductDetail.glassGroup},
                #{ProductDetail.process},
               #{ProductDetail.separation}
                )
        </foreach>
    </insert>
 
    <select id="getGlassNameByGroup">
    SELECT GROUP_CONCAT(detail SEPARATOR '+')
    from sd.product_detail
    where prod_id = #{productId}
      and glass_sort >= #{minTechnologyNumberByGroup}
      and glass_sort &gt;= #{minTechnologyNumberByGroup}
    </select>
 
    <select id="getGlassName">
        SELECT GROUP_CONCAT(detail SEPARATOR '+')
        from sd.product_detail
        where prod_id = #{productId} and detail_type='glass'
    </select>
</mapper>