bug修改
							parent
							
								
									94a6af5fef
								
							
						
					
					
						commit
						bd23124565
					
				| @ -1,133 +1,134 @@ | ||||
| <?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.glxp.api.dao.purchase.PurOrderDetailDao"> | ||||
|   <resultMap id="BaseResultMap" autoMapping="true"  type="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|     <!--@mbg.generated--> | ||||
|     <!--@Table pur_order_detail--> | ||||
| <!--    <id column="id" jdbcType="INTEGER" property="id" />--> | ||||
|     <result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk" /> | ||||
|     <result column="productId" jdbcType="INTEGER" property="productId" /> | ||||
|     <result column="productName" jdbcType="VARCHAR" property="productName" /> | ||||
|     <result column="count" jdbcType="INTEGER" property="count" /> | ||||
|     <result column="supId" jdbcType="VARCHAR" property="supId" /> | ||||
|     <result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh" /> | ||||
|   </resultMap> | ||||
|   <sql id="Base_Column_List"> | ||||
|     <!--@mbg.generated--> | ||||
|     id, orderIdFk, productId, productName, `count`, supId, zczbhhzbapzbh | ||||
|   </sql> | ||||
| 
 | ||||
| 
 | ||||
|   <select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest" | ||||
|           resultType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|     select * | ||||
|     FROM pur_order_detail | ||||
|     <where> | ||||
|       <if test="orderIdFk != '' and orderIdFk != null"> | ||||
|         AND orderIdFk = #{orderIdFk} | ||||
|       </if> | ||||
|       <if test="productId != null"> | ||||
|         AND productId = #{productId} | ||||
|       </if> | ||||
|       <if test="supId != '' and supId != null"> | ||||
|         AND supId = #{supId} | ||||
|       </if> | ||||
|     </where> | ||||
| 
 | ||||
|   </select> | ||||
| 
 | ||||
|   <select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest" | ||||
|           resultType="com.glxp.api.res.purchase.PurOrderDetailResponse"> | ||||
|     SELECT | ||||
|     pur_order_detail.*, | ||||
|     basic_products.ggxh spec, | ||||
|     basic_products.measname, | ||||
|     basic_products.manufactory, | ||||
|     basic_products.ylqxzcrbarmc, | ||||
|     basic_corp.`name` supName | ||||
|     FROM | ||||
|     pur_order_detail | ||||
|     INNER JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id | ||||
|     INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid | ||||
|     INNER JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId | ||||
|     <where> | ||||
|       <if test="orderIdFk != '' and orderIdFk != null"> | ||||
|         AND orderIdFk = #{orderIdFk} | ||||
|         AND basic_products.diType=1 | ||||
|       </if> | ||||
|       <if test="productId != null"> | ||||
|         AND productId = #{productId} | ||||
|       </if> | ||||
|       <if test="supId != '' and supId != null"> | ||||
|         AND supId = #{supId} | ||||
|       </if> | ||||
|     </where> | ||||
| 
 | ||||
|   </select> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   <delete id="deleteByIds" parameterType="java.util.List"> | ||||
|     DELETE FROM pur_order_detail WHERE id in | ||||
|     <foreach collection="ids" item="item" open="(" separator="," close=")"> | ||||
|       #{item} | ||||
|     </foreach> | ||||
|   </delete> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   <delete id="deleteByOrderId" parameterType="map"> | ||||
|     DELETE | ||||
|     FROM pur_order_detail | ||||
|     WHERE orderIdFk = #{orderIdFk} | ||||
|   </delete> | ||||
| 
 | ||||
|   <update id="update" parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|     UPDATE pur_order_detail | ||||
|     <trim prefix="set" suffixOverrides=","> | ||||
|       <if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if> | ||||
|       <if test="productId != null">productId=#{productId},</if> | ||||
|       <if test="productName != null">productName=#{productName},</if> | ||||
|       <if test="count != null">`count`=#{count},</if> | ||||
|       <if test="supId != null">supId=#{supId},</if> | ||||
|       <if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if> | ||||
|     </trim> | ||||
|     WHERE id = #{id} | ||||
|   </update> | ||||
| 
 | ||||
| 
 | ||||
|   <insert id="insertPurOrderDetailEntity" keyProperty="id"  parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|     REPLACE INTO pur_order_detail | ||||
|     ( orderIdFk,productId,productName,count,supId,zczbhhzbapzbh) values | ||||
| 
 | ||||
|     <foreach collection="datas" item="item" index="index" separator=","> | ||||
|       ( | ||||
|       #{item.orderIdFk}, | ||||
|       #{item.productId}, | ||||
|       #{item.productName}, | ||||
|       #{item.count}, | ||||
|       #{item.supId}, | ||||
|       #{item.zczbhhzbapzbh} | ||||
|       ) | ||||
|     </foreach> | ||||
|   </insert> | ||||
| 
 | ||||
|   <select id="selectIoOrderDetailBiz" parameterType="long" | ||||
|           resultType="com.glxp.api.entity.basic.BasicProductsEntity"> | ||||
|     SELECT | ||||
|     b2.* | ||||
|     FROM | ||||
|     pur_order_detail p1 | ||||
|     LEFT JOIN basic_udirel b1 on b1.id=p1.productId | ||||
|     LEFT JOIN basic_products b2 on b1.uuid = b2 .uuid | ||||
|     <where> | ||||
|       <if test="id != null and id!='' "> | ||||
|         AND p1.id = #{id} | ||||
|       </if> | ||||
|     </where> | ||||
|     GROUP BY uuid | ||||
|   </select> | ||||
| 
 | ||||
| </mapper> | ||||
|     <resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|         <!--@mbg.generated--> | ||||
|         <!--@Table pur_order_detail--> | ||||
|         <!--    <id column="id" jdbcType="INTEGER" property="id" />--> | ||||
|         <result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk"/> | ||||
|         <result column="productId" jdbcType="INTEGER" property="productId"/> | ||||
|         <result column="productName" jdbcType="VARCHAR" property="productName"/> | ||||
|         <result column="count" jdbcType="INTEGER" property="count"/> | ||||
|         <result column="supId" jdbcType="VARCHAR" property="supId"/> | ||||
|         <result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh"/> | ||||
|     </resultMap> | ||||
|     <sql id="Base_Column_List"> | ||||
|         <!--@mbg.generated--> | ||||
|         id, orderIdFk, productId, productName, `count`, supId, zczbhhzbapzbh | ||||
|     </sql> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest" | ||||
|             resultType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|         select * | ||||
|         FROM pur_order_detail | ||||
|         <where> | ||||
|             <if test="orderIdFk != '' and orderIdFk != null"> | ||||
|                 AND orderIdFk = #{orderIdFk} | ||||
|             </if> | ||||
|             <if test="productId != null"> | ||||
|                 AND productId = #{productId} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest" | ||||
|             resultType="com.glxp.api.res.purchase.PurOrderDetailResponse"> | ||||
|         SELECT pur_order_detail.*, | ||||
|                basic_products.ggxh spec, | ||||
|                basic_products.measname, | ||||
|                basic_products.manufactory, | ||||
|                basic_products.ylqxzcrbarmc, | ||||
|                basic_corp.`name`   supName | ||||
|         FROM pur_order_detail | ||||
|                      left JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id | ||||
|                      left JOIN basic_products ON basic_udirel.uuid = basic_products.uuid | ||||
|                      left JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId | ||||
|         <where> | ||||
|             <if test="orderIdFk != '' and orderIdFk != null"> | ||||
|                 AND orderIdFk = #{orderIdFk} | ||||
|                     AND basic_products.diType = 1 | ||||
|             </if> | ||||
|             <if test="productId != null"> | ||||
|                 AND productId = #{productId} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteByIds" parameterType="java.util.List"> | ||||
|         DELETE | ||||
|         FROM pur_order_detail WHERE id in | ||||
|         <foreach collection="ids" item="item" open="(" separator="," close=")"> | ||||
|             #{item} | ||||
|         </foreach> | ||||
|     </delete> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteByOrderId" parameterType="map"> | ||||
|         DELETE | ||||
|         FROM pur_order_detail | ||||
|         WHERE orderIdFk = #{orderIdFk} | ||||
|     </delete> | ||||
| 
 | ||||
|     <update id="update" parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|         UPDATE pur_order_detail | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="orderIdFk != null"> | ||||
|                 orderIdFk=#{orderIdFk}, | ||||
|             </if> | ||||
|             <if test="productId != null"> | ||||
|                 productId=#{productId}, | ||||
|             </if> | ||||
|             <if test="productName != null"> | ||||
|                 productName=#{productName}, | ||||
|             </if> | ||||
|             <if test="count != null"> | ||||
|                 `count`=#{count}, | ||||
|             </if> | ||||
|             <if test="supId != null"> | ||||
|                 supId=#{supId}, | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != null"> | ||||
|                 zczbhhzbapzbh=#{zczbhhzbapzbh}, | ||||
|             </if> | ||||
|         </trim> | ||||
|         WHERE id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="insertPurOrderDetailEntity" keyProperty="id" | ||||
|             parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|         REPLACE INTO pur_order_detail | ||||
|                 (orderIdFk, productId, productName, count, supId, zczbhhzbapzbh) values | ||||
| 
 | ||||
|         <foreach collection="datas" item="item" index="index" separator=","> | ||||
|             (#{item.orderIdFk}, | ||||
|              #{item.productId}, | ||||
|              #{item.productName}, | ||||
|              #{item.count}, | ||||
|              #{item.supId}, | ||||
|              #{item.zczbhhzbapzbh}) | ||||
|         </foreach> | ||||
|     </insert> | ||||
| 
 | ||||
|     <select id="selectIoOrderDetailBiz" parameterType="long" | ||||
|             resultType="com.glxp.api.entity.basic.BasicProductsEntity"> | ||||
|         SELECT b2.* | ||||
|         FROM pur_order_detail p1 | ||||
|                      LEFT JOIN basic_udirel b1 on b1.id = p1.productId | ||||
|                      LEFT JOIN basic_products b2 on b1.uuid = b2.uuid | ||||
|         <where> | ||||
|             <if test="id != null and id != ''"> | ||||
|                 AND p1.id = #{id} | ||||
|             </if> | ||||
|         </where> | ||||
|         GROUP BY uuid | ||||
|     </select> | ||||
| </mapper> | ||||
|  | ||||
					Loading…
					
					
				
		Reference in New Issue