1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?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.fjhx.sale.mapper.pack.PackShipmentMapper">
- <select id="getPage" resultType="com.fjhx.sale.entity.pack.vo.PackShipmentVo">
- select
- ps.id,
- ps.pack_detail_ids,
- ps.contract_id,
- ps.remark,
- ps.update_time,
- ps.update_user,
- ps.create_user,
- ps.create_time
- from pack_shipment ps
- ${ew.customSqlSegment}
- </select>
- <select id="getList" resultType="com.fjhx.sale.entity.pack.vo.PackShipmentVo">
- select
- ps.*,
- c.code contractCode
- from pack_shipment ps
- left join contract c on ps.contract_id = c.id
- ${ew.customSqlSegment}
- </select>
- <select id="productDetailList" resultType="java.util.Map">
- SELECT
- dg.id AS businessId,
- json_unquote( pi.standard_json -> '$.englishName' ) remark,
- dg.product_name AS subDescription,
- json_unquote ( pi.standard_json -> '$.customsCode' ) AS customsCode,
- dg.quantity,
- cp.price AS price,
- 20 AS type
- FROM
- pack_detail_product dg
- LEFT JOIN bytesailing_item.product_info pi ON dg.product_id = pi.id
- LEFT JOIN contract_product cp ON dg.contract_product_id = cp.id
- <where>
- <include refid="productDetail"/>
- </where>
- UNION
- SELECT
- id as businessId,
- product_name remark,
- null as subDescription,
- null as customsCode,
- quantity,
- null as price,
- 20 as type
- FROM
- pack_detail_product dg
- <where>
- <include refid="productDetail"/>
- </where>
- </select>
- <sql id="productDetail">
- <foreach collection="ids" item="id" open="dg.pack_detail_id in(" separator="," close=")">
- #{id}
- </foreach>
- </sql>
- </mapper>
|