Merge branch 'dev' into test
						commit
						39f3fbf14d
					
				| @ -0,0 +1,88 @@ | ||||
| package com.glxp.api.controller.inout; | ||||
| 
 | ||||
| import cn.hutool.core.util.IdUtil; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import com.glxp.api.entity.inout.IoOrderMutiSetEntity; | ||||
| import com.glxp.api.req.inout.FilterCodeRequest; | ||||
| import com.glxp.api.req.inout.IoOrderMutiSetRequest; | ||||
| import com.glxp.api.res.inout.IoCodeResponse; | ||||
| import com.glxp.api.res.inout.IoOrderMutiSetResponse; | ||||
| import com.glxp.api.service.inout.IoOrderMutiSetService; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| public class IoOrderMutiSetController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private IoOrderMutiSetService ioOrderMutiSetService; | ||||
| 
 | ||||
|     @GetMapping("/udiwms/inout/muti/filterList") | ||||
|     public BaseResponse filterList(IoOrderMutiSetRequest ioOrderMutiSetRequest) { | ||||
|         List<IoOrderMutiSetResponse> list = ioOrderMutiSetService.filterList(ioOrderMutiSetRequest); | ||||
|         PageInfo<IoOrderMutiSetResponse> pageInfo = new PageInfo<>(list); | ||||
|         return ResultVOUtils.page(pageInfo); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @PostMapping("/udiwms/inout/muti/add") | ||||
|     public BaseResponse addIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||
| 
 | ||||
|         QueryWrapper<IoOrderMutiSetEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("curInv",ioOrderMutiSetEntity.getCurInv()); | ||||
|         long count=ioOrderMutiSetService.count(ew); | ||||
|         if(count>0){ | ||||
|             return ResultVOUtils.error(999,"已存在该仓库的出入库设置!"); | ||||
|         } | ||||
| 
 | ||||
|         ioOrderMutiSetEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|         ioOrderMutiSetEntity.setUpdateTime(new Date()); | ||||
|         Boolean falg=ioOrderMutiSetService.save(ioOrderMutiSetEntity); | ||||
|         if(falg){ | ||||
|             return  ResultVOUtils.success(); | ||||
|         }else{ | ||||
|             return ResultVOUtils.error(999,"添加失败"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @PostMapping("/udiwms/inout/muti/update") | ||||
|     public BaseResponse updateIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||
| 
 | ||||
|         QueryWrapper<IoOrderMutiSetEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("curInv",ioOrderMutiSetEntity.getCurInv()); | ||||
|         IoOrderMutiSetEntity ioOrderMutiSetServiceOne=ioOrderMutiSetService.getOne(ew); | ||||
|         if(!ioOrderMutiSetServiceOne.getId().equals(ioOrderMutiSetEntity.getId())){ | ||||
|             return ResultVOUtils.error(999,"已存在该仓库的出入库设置!"); | ||||
|         } | ||||
| 
 | ||||
|         ioOrderMutiSetEntity.setUpdateTime(new Date()); | ||||
|         Boolean falg=ioOrderMutiSetService.updateById(ioOrderMutiSetEntity); | ||||
|         if(falg){ | ||||
|             return  ResultVOUtils.success(); | ||||
|         }else{ | ||||
|             return ResultVOUtils.error(999,"更新失败"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @PostMapping("/udiwms/inout/muti/detail") | ||||
|     public BaseResponse detailIoOrderMuti(@RequestBody IoOrderMutiSetEntity ioOrderMutiSetEntity) { | ||||
| 
 | ||||
|         Boolean falg=ioOrderMutiSetService.removeById(ioOrderMutiSetEntity); | ||||
|         if(falg){ | ||||
|             return  ResultVOUtils.success(); | ||||
|         }else{ | ||||
|             return ResultVOUtils.error(999,"删除失败"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,39 @@ | ||||
| package com.glxp.api.req.inout; | ||||
| 
 | ||||
| import com.glxp.api.util.page.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| public class IoOrderMutiRequest extends ListPageRequest { | ||||
| 
 | ||||
|     private Long id; | ||||
|     private String orderIdFk; | ||||
|     private String udiCode; | ||||
|     private String relIdFk; | ||||
|     private String mark; | ||||
|     private Integer totalCount; | ||||
|     private Integer useCount; | ||||
|     private Integer reCount; | ||||
|     private Date createTime; | ||||
|     private Date updateTime; | ||||
|     private String createUser; | ||||
|     private String updateUser; | ||||
|     private String reamrk; | ||||
|     private String nameCode; | ||||
|     private String batchNo; | ||||
|     private String produceDate; | ||||
|     private String expireDate; | ||||
|     private String serialNo; | ||||
|     private String supId; | ||||
|     private String auditUser; | ||||
|     private Date auditTime; | ||||
|     private String cpmctymc; | ||||
|     private String ggxh; | ||||
|     private Integer status; | ||||
|     private String createUserName; | ||||
|     private String startDate; | ||||
|     private String endDate; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| package com.glxp.api.req.inout; | ||||
| 
 | ||||
| import com.glxp.api.util.page.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| public class IoOrderMutiSetRequest extends ListPageRequest { | ||||
| 
 | ||||
|     private Long id; | ||||
|     private String curInv; | ||||
|     private String fromCorp; | ||||
|     private String targetAction; | ||||
|     private String remark; | ||||
|     private Date updateTime; | ||||
|     private String invName; | ||||
|     private String fromCorpName; | ||||
|     private String targetActionName; | ||||
|     private Integer checkUse; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,41 @@ | ||||
| package com.glxp.api.res.inout; | ||||
| 
 | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| public class IoOrderMutiResponse { | ||||
| 
 | ||||
|     private Long id; | ||||
|     private String orderIdFk; | ||||
|     private String udiCode; | ||||
|     private String relIdFk; | ||||
|     private String mark; | ||||
|     private Integer totalCount; | ||||
|     private Integer useCount; | ||||
|     private Integer reCount; | ||||
|     private Date createTime; | ||||
|     private Date updateTime; | ||||
|     private String createUser; | ||||
|     private String updateUser; | ||||
|     private String reamrk; | ||||
|     private String nameCode; | ||||
|     private String batchNo; | ||||
|     private String produceDate; | ||||
|     private String expireDate; | ||||
|     private String serialNo; | ||||
|     private String supId; | ||||
|     private String auditUser; | ||||
|     private Date auditTime; | ||||
|     private String cpmctymc; | ||||
|     private String ggxh; | ||||
|     private Integer status; | ||||
|     private String createUserName; | ||||
|     private String auditUserName; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package com.glxp.api.res.inout; | ||||
| 
 | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| @Data | ||||
| public class IoOrderMutiSetResponse { | ||||
| 
 | ||||
|     private Long id; | ||||
|     private String curInv; | ||||
|     private String fromCorp; | ||||
|     private String targetAction; | ||||
|     private String remark; | ||||
|     private Date updateTime; | ||||
|     private String invName; | ||||
|     private String fromCorpName; | ||||
|     private String targetActionName; | ||||
|     private Integer checkUse; | ||||
| 
 | ||||
| } | ||||
| @ -1,11 +1,35 @@ | ||||
| package com.glxp.api.service.inout.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.req.inout.IoOrderMutiRequest; | ||||
| import com.glxp.api.res.inout.IoOrderMutiResponse; | ||||
| import com.glxp.api.res.inout.IoOrderMutiSetResponse; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.glxp.api.entity.inout.IoOrderMutiEntity; | ||||
| import com.glxp.api.dao.inout.IoOrderMutiMapper; | ||||
| import com.glxp.api.service.inout.IoOrderMutiService; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class IoOrderMutiServiceImpl extends ServiceImpl<IoOrderMutiMapper, IoOrderMutiEntity> implements IoOrderMutiService{ | ||||
| 
 | ||||
|     @Resource | ||||
|     private IoOrderMutiMapper ioOrderMutiMapper; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<IoOrderMutiResponse> filterList(IoOrderMutiRequest ioOrderMutiRequest) { | ||||
|         if (ioOrderMutiRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (ioOrderMutiRequest.getPage() != null) { | ||||
|             int offset = (ioOrderMutiRequest.getPage() - 1) * ioOrderMutiRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, ioOrderMutiRequest.getLimit()); | ||||
|         } | ||||
|         List<IoOrderMutiResponse> ioOrderMutiEntityList=ioOrderMutiMapper.filterList(ioOrderMutiRequest); | ||||
|         return ioOrderMutiEntityList; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,11 +1,35 @@ | ||||
| package com.glxp.api.service.inout.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.req.inout.IoOrderMutiSetRequest; | ||||
| import com.glxp.api.res.inout.IoOrderMutiSetResponse; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.glxp.api.entity.inout.IoOrderMutiSetEntity; | ||||
| import com.glxp.api.dao.inout.IoOrderMutiSetMapper; | ||||
| import com.glxp.api.service.inout.IoOrderMutiSetService; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class IoOrderMutiSetServiceImpl extends ServiceImpl<IoOrderMutiSetMapper, IoOrderMutiSetEntity> implements IoOrderMutiSetService{ | ||||
| 
 | ||||
|     @Resource | ||||
|     private IoOrderMutiSetMapper ioOrderMutiSetMapper; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<IoOrderMutiSetResponse> filterList(IoOrderMutiSetRequest ioOrderMutiSetRequest) { | ||||
| 
 | ||||
|         if (ioOrderMutiSetRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (ioOrderMutiSetRequest.getPage() != null) { | ||||
|             int offset = (ioOrderMutiSetRequest.getPage() - 1) * ioOrderMutiSetRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, ioOrderMutiSetRequest.getLimit()); | ||||
|         } | ||||
|         List<IoOrderMutiSetResponse> ioOrderMutiSetEntityList=ioOrderMutiSetMapper.filterList(ioOrderMutiSetRequest); | ||||
|         return ioOrderMutiSetEntityList; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,4 +1,48 @@ | ||||
| <?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.inout.IoOrderMutiMapper"> | ||||
| 
 | ||||
|     <select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiRequest" | ||||
|             resultType="com.glxp.api.res.inout.IoOrderMutiResponse"> | ||||
|         SELECT | ||||
|         io.*, | ||||
|         b1.ggxh, | ||||
|         b1.cpmctymc, | ||||
|         (SELECT userName FROM auth_user WHERE auth_user.id=io.createUser) as createUserName, | ||||
|         (SELECT userName FROM auth_user WHERE auth_user.id=io.auditUser) as auditUserName | ||||
|         FROM | ||||
|         io_order_muti io | ||||
|         LEFT JOIN basic_products b1 on b1.nameCode=io.nameCode | ||||
|         <where> | ||||
|             <if test=" udiCode!= '' and udiCode != null"> | ||||
|                 and io.udiCode = #{udiCode} | ||||
|             </if> | ||||
|             <if test=" mark!= '' and mark != null"> | ||||
|                 and io.mark = #{mark} | ||||
|             </if> | ||||
|             <if test=" orderIdFk!= '' and orderIdFk != null"> | ||||
|                 and io.orderIdFk = #{orderIdFk} | ||||
|             </if> | ||||
|             <if test=" nameCode!= '' and nameCode != null"> | ||||
|                 and io.nameCode = #{nameCode} | ||||
|             </if> | ||||
|             <if test=" ggxh!= '' and ggxh != null"> | ||||
|                 and b1.ggxh = #{ggxh} | ||||
|             </if> | ||||
|             <if test=" cpmctymc!= '' and cpmctymc != null"> | ||||
|                 and b1.cpmctymc = #{cpmctymc} | ||||
|             </if> | ||||
|             <if test="status != null"> | ||||
|                 and io.status = #{status} | ||||
|             </if> | ||||
|             <if test=" createUser!= '' and createUser != null"> | ||||
|                 and io.createUser = #{createUser} | ||||
|             </if> | ||||
|             <if test="startDate != null and startDate != '' and endDate != null and endDate != ''"> | ||||
|                 AND date_format(io.createTime, '%Y-%m-%d') between date_format(#{startDate}, | ||||
|                 '%Y-%m-%d') and date_format(#{endDate}, '%Y-%m-%d') | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
| </mapper> | ||||
|  | ||||
| @ -1,4 +1,18 @@ | ||||
| <?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.inout.IoOrderMutiSetMapper"> | ||||
|     <select id="filterList" parameterType="com.glxp.api.req.inout.IoOrderMutiSetRequest" | ||||
|             resultType="com.glxp.api.res.inout.IoOrderMutiSetResponse"> | ||||
|         SELECT io.*, | ||||
|                (SELECT NAME FROM auth_warehouse aw WHERE aw.CODE = io.curInv)                 invName, | ||||
|                (SELECT NAME FROM basic_corp bc WHERE bc.erpId = io.fromCorp)                  fromCorpName, | ||||
|                (SELECT NAME FROM basic_bussiness_type bus WHERE bus.action = io.targetAction) targetActionName | ||||
|         FROM io_order_muti_set io | ||||
|         left join auth_warehouse a1 on a1.code=io.curInv | ||||
|         <where> | ||||
|             <if test=" curInv!= '' and curInv != null"> | ||||
|                 and a1.name = #{curInv} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| </mapper> | ||||
|  | ||||
| @ -1,177 +1,184 @@ | ||||
| <?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.nameCode nameCode, | ||||
|     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> | ||||
| 
 | ||||
|     <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> | ||||
| 
 | ||||
|   <insert id="insertPurOrderDetailEntity" keyProperty="id"  parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity"> | ||||
|     REPLACE INTO pur_order_detail | ||||
|     ( orderIdFk,productId,productName,count,supId,zczbhhzbapzbh) values | ||||
|     <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.nameCode nameCode, | ||||
|                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> | ||||
| 
 | ||||
|     <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> | ||||
|     <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> | ||||
|             <if test="price != null"> | ||||
|                 price=#{price}, | ||||
|             </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, price) values | ||||
| 
 | ||||
|         <foreach collection="datas" item="item" index="index" separator=","> | ||||
|             (#{item.orderIdFk}, | ||||
|              #{item.productId}, | ||||
|              #{item.productName}, | ||||
|              #{item.count}, | ||||
|              #{item.supId}, | ||||
|              #{item.zczbhhzbapzbh}, #{item.price}) | ||||
|         </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> | ||||
| 
 | ||||
|   <select id="selectDetailList" resultType="com.glxp.api.res.purchase.PurOrderDetailResponse"> | ||||
|     SELECT | ||||
|     pur_order_detail.*, | ||||
|     pur_order.billNo, | ||||
|     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 | ||||
|     left join pur_order on pur_order.id = pur_order_detail.orderIdFk | ||||
|     <where> | ||||
|       <if test="billNo != null and billNo != ''"> | ||||
|         AND pur_order.billNo like concat('%', #{billNo}, '%') | ||||
|       </if> | ||||
|       <if test="productId != null"> | ||||
|         AND productId like concat('%', #{productId}, '%') | ||||
|       </if> | ||||
|       <if test="productName != null and productName != ''"> | ||||
|         AND productName like concat('%', #{productName}, '%') | ||||
|       </if> | ||||
|       <if test="spec != null and spec != ''"> | ||||
|         AND basic_products.ggxh like concat('%', #{spec}, '%') | ||||
|       </if> | ||||
|       <if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''"> | ||||
|         AND pur_order_detail.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') | ||||
|       </if> | ||||
|       <if test="manufactory != null and manufactory != ''"> | ||||
|         AND basic_products.manufactory like concat('%', #{manufactory}, '%') | ||||
|       </if> | ||||
|       <if test="startDate != null and startDate !=''"> | ||||
|         <![CDATA[ and DATE_FORMAT(pur_order.createTime,'%Y-%m-%d')>= #{startDate}]]> | ||||
|       </if> | ||||
|       <if test="endDate != null and endDate !=''"> | ||||
|         <![CDATA[ and DATE_FORMAT(pur_order.createTime,'%Y-%m-%d') <= #{endDate}]]> | ||||
|       </if> | ||||
|       and pur_order.status=3 | ||||
|     </where> | ||||
|     <select id="selectDetailList" resultType="com.glxp.api.res.purchase.PurOrderDetailResponse"> | ||||
|         SELECT pur_order_detail.*, | ||||
|                pur_order.billNo, | ||||
|                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 | ||||
|                      left join pur_order on pur_order.id = pur_order_detail.orderIdFk | ||||
|         <where> | ||||
|             <if test="billNo != null and billNo != ''"> | ||||
|                 AND pur_order.billNo like concat('%', #{billNo}, '%') | ||||
|             </if> | ||||
|             <if test="productId != null"> | ||||
|                 AND productId like concat('%', #{productId}, '%') | ||||
|             </if> | ||||
|             <if test="productName != null and productName != ''"> | ||||
|                 AND productName like concat('%', #{productName}, '%') | ||||
|             </if> | ||||
|             <if test="spec != null and spec != ''"> | ||||
|                 AND basic_products.ggxh like concat('%', #{spec}, '%') | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''"> | ||||
|                 AND pur_order_detail.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') | ||||
|             </if> | ||||
|             <if test="manufactory != null and manufactory != ''"> | ||||
|                 AND basic_products.manufactory like concat('%', #{manufactory}, '%') | ||||
|             </if> | ||||
|             <if test="startDate != null and startDate != ''"> | ||||
|                 <![CDATA[ | ||||
|                 and DATE_FORMAT(pur_order.createTime, '%Y-%m-%d') >= #{startDate} | ||||
|                 ]]> | ||||
|             </if> | ||||
|             <if test="endDate != null and endDate != ''"> | ||||
|                 <![CDATA[ | ||||
|                 and DATE_FORMAT(pur_order.createTime, '%Y-%m-%d') <= #{endDate} | ||||
|                 ]]> | ||||
|             </if> | ||||
|             and pur_order.status = 3 | ||||
|         </where> | ||||
|     </select> | ||||
| </mapper> | ||||
|  | ||||
					Loading…
					
					
				
		Reference in New Issue