From 14ecea8537d5b29ca64c75aad4ff49265018415d Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期三, 02 七月 2025 08:51:22 +0800 Subject: [PATCH] zjh20250702 --- ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java | 99 ++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 88 insertions(+), 11 deletions(-) diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java index 53e306a..789d03b 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ltkj.hosp.domain.TjOrderDetail; import com.ltkj.hosp.domain.TjProject; +import com.ltkj.hosp.vo.ProFcListVo; import com.ltkj.hosp.vodomain.ShenGaoTiZhongVo; import org.apache.ibatis.annotations.*; @@ -79,11 +80,33 @@ public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNotNull(String orderId); /** + * 鏌ヨ宸茬即璐归」鐩� + */ + @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" + + " SELECT a.pro_id FROM tj_order_detail a WHERE !ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 and a.jxbz = #{jxbz} )") + public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNotNullN(@Param("orderId") String orderId,@Param("jxbz") String jxbz); + + @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" + + " SELECT a.pro_id FROM tj_order_detail a WHERE !ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 and a.jxbz is null )") + List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNotNullAndJxbzIsNull(String orderId); + + /** * 鏌ヨ鏈即璐归」鐩� */ @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" + " SELECT a.pro_id FROM tj_order_detail a WHERE ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 )") public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNull(String orderId); + + /** + * 鏌ヨ鏈即璐归」鐩� + */ + @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" + + " SELECT a.pro_id FROM tj_order_detail a WHERE ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 and a.jxbz = #{jxbz} )") + public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNullN(@Param("orderId") String orderId,@Param("jxbz") String jxbz); + + @Select("SELECT * FROM tj_project p WHERE p.pro_parent_id =0 AND p.pro_id IN (\n" + + " SELECT a.pro_id FROM tj_order_detail a WHERE ISNULL(flowing_water_id) AND order_id=#{orderId} and a.deleted=0 and a.jxbz is null )") + List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNullAndJxbzIsNull(String orderId); @Select("SELECT * FROM tj_order_detail WHERE order_id=#{orderId} AND !ISNULL(flowing_water_id) AND deleted='0'") @@ -121,12 +144,14 @@ " create_id,\n" + " pro_type) \n" + " \n" + - " SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.cus_id=#{cusId} \n" + + " SELECT #{orderId},a.pro_id,IFNULL(trim(b.pro_default),null),IF(b.need_report<>'Y',1,0),SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0)" + + " FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} \n" + "\t\t\n" + "\tUNION\n" + " \n" + - "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id WHERE a.cus_id=#{cusId} GROUP BY a.parent_pro_id") - boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId); + "\tSELECT #{orderId},a.parent_pro_id,IFNULL(trim(b.pro_default),null),IF(b.need_report<>'Y',1,0),SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) " + + "FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} GROUP BY a.parent_pro_id") + boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId,@Param("cardId") String cardId); @Insert("\tINSERT INTO tj_order_detail(\n" + @@ -139,14 +164,18 @@ " create_by,\n" + " is_sampling,\n" + " create_id,\n" + - " pro_type) \n" + + " pro_type," + + "flowing_water_id) \n" + " \n" + - " SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'1',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.cus_id=#{cusId} \n" + + " SELECT #{orderId},a.pro_id,IFNULL(trim(b.pro_default),null),'1',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) ,#{sl}" + + "FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} \n" + "\t\t\n" + "\tUNION\n" + " \n" + - "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id WHERE a.cus_id=#{cusId} GROUP BY a.parent_pro_id") - boolean saveJSYTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId); + "\tSELECT #{orderId},a.parent_pro_id,IFNULL(trim(b.pro_default),null),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) ,#{sl}" + + " FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} GROUP BY a.parent_pro_id") + boolean saveJSYTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId, + @Param("cardId") String cardId,@Param("sl") String sl); @@ -160,10 +189,10 @@ "\tcreate_time,\n" + "\tcreate_id\n" + ")\n" + - "SELECT #{tjNum},b.cus_id,b.cus_name,'1633660948860522619','绾煶鍚槇'," + + "SELECT #{tjNum},b.cus_id,b.cus_name,'1740177341251154247','绾煶鍚槇'," + "#{userName},SYSDATE(),#{userId} FROM tb_transition a LEFT JOIN tj_customer b " + - "ON a.cus_id=b.cus_idcard WHERE a.cus_id=#{cusId} AND a.parent_pro_id IN('1633660948860522619') GROUP BY a.cus_id") - boolean saveTjPureToneTesByCusId(@Param("cusId")String cusId,@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId); + "ON a.cus_id=b.cus_idcard WHERE a.cus_id=#{cusId} AND a.card_id=#{cardId} AND a.parent_pro_id IN('1740177341251154247') GROUP BY a.cus_id") + boolean saveTjPureToneTesByCusId(@Param("cusId")String cusId,@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId,@Param("cardId") String cardId); @Update("UPDATE tj_order_detail a SET\n" + @@ -179,7 +208,7 @@ "FROM `tj_order_detail` \n" + "where order_id=#{orderId}\n" + "and pro_id IN\n" + - "(select pro_id from tj_project where pro_parent_id=#{proParentId})") + "(select pro_id from tj_project where pro_parent_id=#{proParentId} and deleted=0 and pro_status=0)") public List<TjOrderDetail> getDetailByOrderIdAndParId(@Param("orderId")Long orderId,@Param("proParentId")Long proParentId); public List<TjOrderDetail> getDetailByOrderIdAndParIds(@Param("orderId")Long orderId,@Param("proParentIds")List<Long> proParentIds); @@ -226,4 +255,52 @@ "\t\tOR c.pro_name LIKE '%鑸掑紶鍘�%' \n" + "\t)) aa ") List<ShenGaoTiZhongVo> getShenGaoTiZhongList(String tjNum); + + + +// @Select("SELECT a.* FROM tj_order_detail a LEFT JOIN tj_project b ON a.pro_id=b.pro_id \n" + +// "LEFT JOIN sys_dept c ON c.dept_id=b.dept_id \n" + +// " WHERE a.deleted=0 AND !ISNULL(a.flowing_water_id) AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1") + @Select("SELECT a.* FROM tj_order_detail a LEFT JOIN tj_project b ON a.pro_id=b.pro_id \n" + + "LEFT JOIN sys_dept c ON c.dept_id=b.dept_id \n" + + " WHERE a.deleted=0 AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1") + List<TjOrderDetail> getCaiYangDengJi(Long orderId); + + @Select("SELECT a.* FROM tj_order_detail a LEFT JOIN tj_project b ON a.pro_id=b.pro_id \n" + + "LEFT JOIN sys_dept c ON c.dept_id=b.dept_id \n" + + " WHERE a.deleted=0 AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1 AND a.jxbz = #{jxbz}") + List<TjOrderDetail> getCaiYangDengJiJxbz(@Param("orderId") Long orderId,@Param("jxbz") String jxbz); + + + @Select("call tj_check_yclist(1,#{tjnumber,mode=IN})") + List<TjOrderDetail> getzongjianyishengchakanyichangxiangmu(String tjNumber); + + @Select("call tj_check_yclist(4,#{tjNumber,mode=IN})") + List<TjOrderDetail> getzongjianyishengchakanyichangxiangmu4(@Param("tjNumber") String tjNumber); + + @Update("UPDATE tj_order_detail a SET\n" + + "a.flowing_water_id=#{ls} ,\n" + + "a.update_time=SYSDATE()\n" + + "WHERE a.order_id=#{orderId} and a.jxbz=#{jxbz}") + void updateTjOrderDetailsFlowingWaterIdByJxbz(@Param("orderId") String orderId, @Param("jxbz")String jxbz,@Param("ls")String ls); + + + @Update("UPDATE tj_order_detail a SET\n" + + "a.flowing_water_id=#{ls} ,\n" + + "a.update_time=SYSDATE()\n" + + "WHERE a.order_id=#{orderId} and isnull(a.jxbz)") + void updateTjOrderDetailsFlowingWaterIdByJxbzisnull(@Param("orderId") String orderId,@Param("ls")String ls); + + + @Update("UPDATE tj_order_detail a SET\n" + + "a.deleted=1 \n" + + "WHERE a.order_detail_id=#{id}") + void updateTjOrderDetailDel(@Param("id") String id); + + @Select("SELECT p.pro_id,p.pro_name,p.pro_parent_id,o.order_id,p.sl * p.pro_price as price,d.dept_id,d.dept_name\n" + + " FROM tj_order_detail o \n" + + " LEFT JOIN tj_project p ON o.pro_id = p.pro_id\n" + + " LEFT JOIN sys_dept d ON p.dept_id = d.dept_id\n" + + " WHERE order_id = #{orderId} AND p.pro_parent_id <>0 AND o.is_return = #{type}") + List<ProFcListVo> getFcList(@Param("orderId") Long orderId, @Param("type") Integer type); } -- Gitblit v1.8.0