| New file |
| | |
| | | <?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 >= #{minTechnologyNumberByGroup} |
| | | </select> |
| | | </mapper> |