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