| | |
| | | " create_id,\n" + |
| | | " pro_type) \n" + |
| | | " \n" + |
| | | " SELECT #{orderId},a.pro_id,IFNULL(trim(b.pro_default),null),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0)" + |
| | | " 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(trim(b.pro_default),null),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) " + |
| | | "\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); |
| | | 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" + |
| | |
| | | "tj_number,\n" + |
| | | "update_by,\n" + |
| | | "update_time,\n" + |
| | | "update_id\n" + |
| | | "update_id,\n" + |
| | | "type\n" + |
| | | ")\n" + |
| | | "\n" + |
| | | "SELECT b.pro_id,b.dept_id,SYSDATE(),#{userName},#{userId},#{tjNumber},#{userName},SYSDATE(),#{userId} FROM tj_order_detail a " + |
| | | "SELECT b.pro_id,b.dept_id,SYSDATE(),#{userName},#{userId},#{tjNumber},#{userName},SYSDATE(),#{userId},IF(b.need_report<>'Y',1,0) FROM tj_order_detail a " + |
| | | "LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.order_id=#{orderId} AND\n" + |
| | | "b.pro_parent_id=0") |
| | | boolean saveTjOrderRemarkByOrderId(@Param("tjNumber")String tjNumber,@Param("userName") String userName,@Param("userId") String userId,@Param("orderId")String orderId); |
| | |
| | | " LEFT JOIN sys_user us ON us.user_id = re.doctor_name\n" + |
| | | " WHERE\n" + |
| | | // " re.type != 2 AND\n" + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%'" + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%' and pro.need_report='Y'" + |
| | | " <when test='sfzpacs == true'> " + |
| | | " AND dep.org_type = 2"+ |
| | | " </when>"+ |
| | |
| | | |
| | | |
| | | @Select({"<script>", "SELECT a.* FROM tj_order_remark a JOIN tj_project b ON b.pro_id=a.pro_id JOIN sys_dept c ON c.dept_id=a.dept_id ", |
| | | " WHERE b.need_report='Y' AND c.org_type !=1 AND !ISNULL(a.sfbz) AND a.type !=2 AND a.tj_number=#{tjNumber} and a.dept_id in ", |
| | | " WHERE b.need_report='Y' AND c.org_type !=1 AND !ISNULL(a.sfbz) AND a.type !=2 AND a.tj_number=#{tjNumber} and a.dept_id in ", |
| | | "<foreach collection='split' item='id' open='(' separator=',' close=')'>", |
| | | "#{id}", |
| | | "</foreach>", |
| | |
| | | " LEFT JOIN tj_project pro ON re.pro_id = pro.pro_id\n" + |
| | | " LEFT JOIN sys_user us ON us.user_id = re.doctor_name\n" + |
| | | " WHERE\n" + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%' " + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%' and pro.need_report='Y'" + |
| | | " AND dep.org_type in (1,2 )"+ |
| | | "</script>"}) |
| | | List<CsProVo> ysjcGetProByTjNumAndOrderId(@Param("tjNumber") String tjNumber); |
| | |
| | | " LEFT JOIN sys_user us ON us.user_id = re.doctor_name\n" + |
| | | " WHERE\n" + |
| | | // " re.type != 2 AND\n" + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%'" + |
| | | " re.tj_number = #{tjNumber} and re.dept_id !=532 and pro.pro_name not like '%费%' and pro.need_report='Y' " + |
| | | " AND dep.org_type = 1"+ |
| | | "</script>"}) |
| | | List<CsProVo> cSWebGetProByTjNumAndOrderIdJy(String tjNumber); |