上传医保优化

ctyxyb
qiuyt 22 hours ago
parent a1dea0f3af
commit 1442743ce0

@ -49,7 +49,7 @@ import java.util.Map;
@Slf4j
@Service
public abstract class CommonHttpClient implements BaseHttpClient {
@Value("${DSF_XML_SQL_TYPE:Mysql}")
@Value("${DSF_XML_SQL_TYPE:MySQL}")
private String defXmlSqlType;
@Autowired
private HttpClient httpClient;

@ -1422,7 +1422,7 @@ public class CtqyyClient extends CommonHttpClient {
@Override
public BaseResponse getPrescribes(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) {
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) {
if (udiwmsBasicSkPrescribeRequest.getBusType().equals("YPCF003") || udiwmsBasicSkPrescribeRequest.getBusType().equals("YPCF002")) {
log.info("udiwmsBasicSkPrescribeRequest11111"+udiwmsBasicSkPrescribeRequest);
LambdaQueryWrapper<VInsurNationGoodsPhysic> wrapper = new LambdaQueryWrapper<>();
@ -1441,17 +1441,24 @@ public class CtqyyClient extends CommonHttpClient {
.or().like(VInsurNationGoodsPhysic::getPSN_NO, "%"+key+"%")
);
wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsPhysic::getPSN_NAME, fromCorpName));
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
IPage<VYpzsPresInfo> page = new Page<>();
if (udiwmsBasicSkPrescribeRequest.getBusType().equals("YPCF003")) {
udiwmsBasicSkPrescribeRequest.setIN_HOSP("1");
// 住院只拉取结算后的处方
// 拉取处方时改成拉取v_ypzs_pres_info
page = vYpzsPresInfoMapper
.selectGroupedWithPagination(new Page<VYpzsPresInfo>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
} else {
udiwmsBasicSkPrescribeRequest.setIN_HOSP("2");
// 拉取处方时改成拉取v_ypzs_pres_info
page = vYpzsPresInfoMapper
.selectGroupedWithPagination(new Page<VYpzsPresInfo>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
}
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
// 拉取处方时改成拉取v_ypzs_pres_info
IPage<VYpzsPresInfo> page = vYpzsPresInfoMapper
.selectGroupedWithPagination(new Page<VYpzsPresInfo>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
if (page.getTotal() == 0) {
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
@ -1461,27 +1468,15 @@ public class CtqyyClient extends CommonHttpClient {
}
return this.covertSellOrder(udiwmsBasicSkPrescribeRequest, page);
} else {
LambdaQueryWrapper<VInsurNationGoodsReturn> wrapper = new LambdaQueryWrapper<>();
String startTime = udiwmsBasicSkPrescribeRequest.getStartTime();
String endTime = udiwmsBasicSkPrescribeRequest.getEndTime();
wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, startTime);
wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, endTime);
String code = udiwmsBasicSkPrescribeRequest.getCode();
String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName();
String key = udiwmsBasicSkPrescribeRequest.getKey();
wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsReturn::getAPPLY_NO, key)
.or().like(VInsurNationGoodsReturn::getPSN_NAME, key)
.or().like(VInsurNationGoodsReturn::getPSN_NO, key)
);
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsReturn::getAPPLY_NO, code));
wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsReturn::getPSN_NAME, fromCorpName));
udiwmsBasicSkPrescribeRequest.setDatabaseProductName(getDataSourceType());
if (udiwmsBasicSkPrescribeRequest.getBusType().equals("YPCFTF003")) {
udiwmsBasicSkPrescribeRequest.setIN_HOSP("1");
} else {
udiwmsBasicSkPrescribeRequest.setIN_HOSP("2");
}
//拉取处方退货时改成拉取v_ypzs_pres_info_return
IPage<VYpzsPresInfoReturn> page = vYpzsPresInfoReturnMapper.selectGroupedWithPagination(new Page<VYpzsPresInfoReturn>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
@ -1695,7 +1690,7 @@ public class CtqyyClient extends CommonHttpClient {
} else if (matchBusType(busType, buyType_3505)) {
return optionUploadCollectOrder3505(ioCollectOrder);
} else if (matchBusType(busType, buyType_3506)) {
optionUploadCollectOrder3506(ioCollectOrder);
return optionUploadCollectOrder3506(ioCollectOrder);
} else if (matchBusType(busType, buyType_35051)) {
return optionUploadCollectOrder35051(ioCollectOrder);
} else {
@ -2008,13 +2003,22 @@ public class CtqyyClient extends CommonHttpClient {
VYpzsPresInfoReturn presInfoEntity = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
//区分住院、门诊处方
if (IntUtil.value(presInfoEntity.getIO_TYPE()) == 1) {
ioCollectOrder.setBusType("YPCFTF003");
// ioCollectOrder.setBillNo(presInfoEntity.getSTOOUT_NO());
} else {
ioCollectOrder.setBusType("YPCFTF002");
}
ioCollectOrder.setBillNo(presInfoEntity.getAPPLY_NO());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setFromCorp(presInfoEntity.getSICK_ID());
ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode());
ioCollectOrder.setFromCorpName(presInfoEntity.getSICK_NAME());
// Date date = DateUtil.parseDate(presInfoEntity.get());
ioCollectOrder.setBillTime(presInfoEntity.getKEEP_BOOK_TIME());
Date date = DateUtil.parseDate(presInfoEntity.getKEEP_BOOK_TIME());
ioCollectOrder.setBillTime(date);
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser());
ioCollectOrder.setUpdateTime(new Date());
@ -2023,27 +2027,27 @@ public class CtqyyClient extends CommonHttpClient {
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()).last(" limit 1"));
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getCOUNTRY_CODE()).last(" limit 1"));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";");
}
List<VYpzsPresInfoReturn> vYpzsPresInfoReturns = vYpzsPresInfoReturnMapper.selectList(new LambdaQueryWrapper<VYpzsPresInfoReturn>().eq(VYpzsPresInfoReturn::getAPPLY_NO, entity.getAPPLY_NO()).eq(VYpzsPresInfoReturn::getPHYSIC_CODE, entity.getPHYSIC_CODE()));
if (CollUtil.isNotEmpty(vYpzsPresInfoReturns)) {
VYpzsPresInfoReturn vYpzsPresInfo = vYpzsPresInfoReturns.get(0);
collectOrderBiz.setGgxh(vYpzsPresInfo.getPHYSIC_SPEC());
collectOrderBiz.setMeasureUnit(vYpzsPresInfo.getPHYSIC_UNIT());
}
collectOrderBiz.setThrCode(entity.getPHYSIC_CODE());
collectOrderBiz.setGgxh(entity.getPHYSIC_SPEC());
collectOrderBiz.setMeasureUnit(entity.getPHYSIC_UNIT());
collectOrderBiz.setCount(IntUtil.value(entity.getMDTRT_SN()));
collectOrderBiz.setThrCode(entity.getCOUNTRY_CODE());
collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME());
// collectOrderBiz.setBatchNo(entity.getBATCH_NUMBER());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setYbbm(entity.getFEE_SEQUENCE_NO());
collectOrderBiz.setCount(entity.getQUANTITY());
collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
collectOrderBiz.setRemark(entity.getLAYPHYSIC_NO());
collectOrderBiz.setRemark2(entity.getPRESCRIBE_NUMBER());
ioCollectOrder.setRemark(entity.getLAYPHYSIC_NO());
ioCollectOrder.setBackupOrderRemark1(entity.getPRESCRIBE_NUMBER());
bizList.add(collectOrderBiz);
});
if (StrUtil.isNotBlank(errorMsg)) {
@ -2143,7 +2147,7 @@ public class CtqyyClient extends CommonHttpClient {
.manu_date(vInsurNationGoodsPhysic.getMANU_DATE())
.expy_end(vInsurNationGoodsPhysic.getEXPY_END())
.rx_flag(vInsurNationGoodsPhysic.getRX_FLAG())
.trdn_flag(vInsurNationGoodsPhysic.getTRDN_FLAG())
.trdn_flag(collectOrderBizResponse.getTrdnFlag())
.finl_trns_pric(vInsurNationGoodsPhysic.getFINL_TRNS_PRIC())
.rxno(vInsurNationGoodsPhysic.getRXNO())
.rx_circ_flag(vInsurNationGoodsPhysic.getRX_CIRC_FLAG())
@ -2419,22 +2423,26 @@ public class CtqyyClient extends CommonHttpClient {
}
}
public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder) {
public BaseResponse optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder) {
// List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Xsth3506Request> xsth3506Requests = new ArrayList<>();
List<VInsurNationGoodsReturn> vInsurNationGoodsReturns = vInsurNationGoodsReturnMapper.selectList(new LambdaQueryWrapper<VInsurNationGoodsReturn>().eq(VInsurNationGoodsReturn::getAPPLY_NO, ioCollectOrder.getBillNo()));
List<VInsurNationGoodsReturn> vInsurNationGoodsReturns = vInsurNationGoodsReturnMapper.selectList(new LambdaQueryWrapper<VInsurNationGoodsReturn>().eq(VInsurNationGoodsReturn::getAPPLY_NO, ioCollectOrder.getBackupOrderRemark1()));
if (CollUtil.isEmpty(vInsurNationGoodsReturns)) {
log.error("申请单号{}不存在", ioCollectOrder.getBillNo());
return;
return ResultVOUtils.error(500,"上传医保数据为空请核实");
}
for (CollectOrderBizResponse item : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(item.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (VInsurNationGoodsReturn vInsurNationGoodsPhysic : vInsurNationGoodsReturns) {
if (vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID().equals(itemCode)) {
String[] codes = item.getFinishUdiCode().split(",");
if (vInsurNationGoodsPhysic.getMED_LIST_CODG().equals(itemCode)) {
String[] codes = new String[0];
if(StringUtils.isNotEmpty(item.getFinishUdiCode())){
codes = item.getFinishUdiCode().split(",");
}
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
@ -2452,9 +2460,9 @@ public class CtqyyClient extends CommonHttpClient {
}
// TODO: 2024/9/10 字段未完全正确对应
Xsth3506Request xsth3506Request = Xsth3506Request.builder()
.med_list_codg(item.getYbbm())
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.med_list_codg(vInsurNationGoodsPhysic.getMED_LIST_CODG())
.fixmedins_hilist_id(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID())
.fixmedins_hilist_name(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_NAME())
.fixmedins_bchno(vInsurNationGoodsPhysic.getFIXMEDINS_BCHNO())
.setl_id(vInsurNationGoodsPhysic.getSETL_ID())
.psn_no(vInsurNationGoodsPhysic.getPSN_NO())
@ -2470,7 +2478,7 @@ public class CtqyyClient extends CommonHttpClient {
.sel_retn_cnt(vInsurNationGoodsPhysic.getSEL_RETN_CNT())
.sel_retn_time(vInsurNationGoodsPhysic.getSEL_RETN_TIME())
.sel_retn_opter_name(vInsurNationGoodsPhysic.getSEL_RETN_OPTER_NAME())
.memo(item.getRemark())
.memo(vInsurNationGoodsPhysic.getMEMO())
.medins_prod_sel_no(vInsurNationGoodsPhysic.getMEDINS_PROL_SEL_NO())
.mdtrt_sn(vInsurNationGoodsPhysic.getMDTRT_SN())
.drugtracinfo(drugTraceList).build();
@ -2486,6 +2494,8 @@ public class CtqyyClient extends CommonHttpClient {
String jsonStr = JSONUtil.toJsonStr(baseXsth3506Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3506A", dataJson);
return ybClient.ybPostScyh("3505A", dataJson);
}
/**

@ -13,69 +13,126 @@ import lombok.Data;
@Data
@TableName(value = "V_INSUR_NATION_GOODS_RETURN")
public class VInsurNationGoodsReturn {
@TableField(value = "APPLY_NO")
private String APPLY_NO;
/**
*
*/
@TableField(value = "MED_LIST_CODG")
private String MED_LIST_CODG;
/**
*
*/
@TableField(value = "FIXMEDINS_HILIST_ID")
private String FIXMEDINS_HILIST_ID;
/**
*
*/
@TableField(value = "FIXMEDINS_HILIST_NAME")
private String FIXMEDINS_HILIST_NAME;
/**
*
*/
@TableField(value = "FIXMEDINS_BCHNO")
private String FIXMEDINS_BCHNO;
/**
* ID
*/
@TableField(value = "SETL_ID")
private String SETL_ID;
/**
*
*/
@TableField(value = "PSN_NO")
private String PSN_NO;
/**
*
*/
@TableField(value = "PSN_CERT_TYPE")
private String PSN_CERT_TYPE;
/**
*
*/
@TableField(value = "CERTNO")
private String CERTNO;
/**
*
*/
@TableField(value = "PSN_NAME")
private String PSN_NAME;
/**
*
*/
@TableField(value = "MANU_LOTNUM")
private String MANU_LOTNUM;
/**
*
*/
@TableField(value = "MANU_DATE")
private String MANU_DATE;
/**
*
*/
@TableField(value = "EXPY_END")
private String EXPY_END;
/**
*
*/
@TableField(value = "RX_FLAG")
private String RX_FLAG;
/**
*
*/
@TableField(value = "TRDN_FLAG")
private String TRDN_FLAG;
/**
*
*/
@TableField(value = "FINL_TRNS_PRIC")
private BigDecimal FINL_TRNS_PRIC;
/**
* /退
*/
@TableField(value = "SEL_RETN_CNT")
private Integer SEL_RETN_CNT;
/**
* /退
*/
@TableField(value = "SEL_RETN_TIME")
private Date SEL_RETN_TIME;
/**
* /退
*/
@TableField(value = "SEL_RETN_OPTER_NAME")
private String SEL_RETN_OPTER_NAME;
/**
*
*/
@TableField(value = "MEMO")
private String MEMO;
@TableField(value = "MEDINS_PROL_SEL_NO")
private String MEDINS_PROL_SEL_NO;
/**
*
*/
@TableField(value = "DRUGTRACINFO")
private String DRUGTRACINFO;
@ -85,6 +142,12 @@ public class VInsurNationGoodsReturn {
@TableField(value = "SICK_ID")
private String SICK_ID;
@TableField(value = "APPLY_NO")
private String APPLY_NO;
/**
*
*/
@TableField(value = "MDTRT_SN")
private String MDTRT_SN;
}

@ -10,67 +10,149 @@ import java.util.Date;
@Data
@TableName(value = "V_YPZS_PRES_INFO_RETURN")
public class VYpzsPresInfoReturn {
/**
*
*/
@TableField(value = "APPLY_NO")
private String APPLY_NO;
/**
*
*/
@TableField(value = "SICK_ID")
private String SICK_ID;
/**
*
*/
@TableField(value = "STORAGE_CODE")
private Integer STORAGE_CODE;
/**
*
*/
@TableField(value = "DEPT_NAME")
private String DEPT_NAME;
/**
*
*/
@TableField(value = "KEEP_BOOK_TIME")
private Date KEEP_BOOK_TIME;
/**
*
*/
@TableField(value = "KEEP_BOOK_OPERATOR")
private String KEEP_BOOK_OPERATOR;
/**
*
*/
@TableField(value = "SETTLE_NO")
private String SETTLE_NO;
/**
*
*/
@TableField(value = "PHYSIC_CODE")
private String PHYSIC_CODE;
/**
*
*/
@TableField(value = "PHYSIC_NAME")
private String PHYSIC_NAME;
/**
*
*/
@TableField(value = "PHYSIC_SPEC")
private String PHYSIC_SPEC;
/**
*
*/
@TableField(value = "QUANTITY")
private Integer QUANTITY;
/**
*
*/
@TableField(value = "PHYSIC_UNIT")
private String PHYSIC_UNIT;
/**
*
*/
@TableField(value = "PRICE")
private BigDecimal PRICE;
/**
*
*/
@TableField(value = "COST")
private BigDecimal COST;
/**
*
*/
@TableField(value = "BATCH_NUMBER")
private String BATCH_NUMBER;
/**
*
*/
@TableField(value = "FEE_SEQUENCE_NO")
private String FEE_SEQUENCE_NO;
@TableField(value = "MDTRT_SN")
private String MDTRT_SN;
//名字
@TableField(value = "SETL_ID")
private String SETL_ID;
/**
*
*/
@TableField(value = "SICK_NAME")
private String SICK_NAME;
//性别
/**
*
*/
@TableField(value = "SEX")
private String SEX;
/**
*
*/
@TableField(value = "IC_CARD_ID")
private String IC_CARD_ID;
//年龄
/**
*
*/
@TableField(value = "NL")
private String NL;
/**
*
*/
@TableField(value = "PRESCRIBE_NUMBER")
private String PRESCRIBE_NUMBER;
/**
*
*/
@TableField(value = "LAYPHYSIC_NO")
private String LAYPHYSIC_NO;
@TableField(value = "COUNTRY_CODE")
private String COUNTRY_CODE;
@TableField(value = "IO_TYPE")
private String IO_TYPE;
}

@ -132,5 +132,4 @@ public class Xsth3506Request {
private String drug_trac_codg;
}

@ -14,6 +14,8 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface VYpzsPresInfoMapper extends BaseMapper<VYpzsPresInfo> {
IPage<VYpzsPresInfo> selectGroupedWithPagination(Page<VYpzsPresInfo> vYpzsPresInfoPage,@Param("udiwmsBasicSkPrescribeRequest") UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest);
IPage<VYpzsPresInfo> selectGroupedWithPaginationNew(Page<VYpzsPresInfo> vYpzsPresInfoPage,@Param("udiwmsBasicSkPrescribeRequest") UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest);
}
}

@ -112,4 +112,74 @@
ORDER BY
PRESCRIBE_NUMBER
</select>
<select id="selectGroupedWithPaginationNew" resultType="com.glxp.mipsdl.entity.ctqyy.VYpzsPresInfo">
SELECT a.PRESCRIBE_NUMBER
FROM v_ypzs_pres_info a
inner join v_insur_nation_goods_physic b on a.STOOUT_NO = b.STOOUT_NO
<where>
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
<![CDATA[
and a.LAY_TIME >= TO_DATE(#{udiwmsBasicSkPrescribeRequest.startTime}
, 'YYYY-MM-DD HH24:MI:SS')
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
<![CDATA[
and a.LAY_TIME <= TO_DATE(#{udiwmsBasicSkPrescribeRequest.endTime}
, 'YYYY-MM-DD HH24:MI:SS')
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
<![CDATA[
and a.LAY_TIME >= #{udiwmsBasicSkPrescribeRequest.startTime}
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
<![CDATA[
and a.LAY_TIME <= #{udiwmsBasicSkPrescribeRequest.endTime}
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.code != null and udiwmsBasicSkPrescribeRequest.code != ''">
and ( a.STOOUT_NO = #{udiwmsBasicSkPrescribeRequest.code}
or a.PRESCRIBE_NUMBER = #{udiwmsBasicSkPrescribeRequest.code}
)
</if>
<if test="udiwmsBasicSkPrescribeRequest.IN_HOSP != null and udiwmsBasicSkPrescribeRequest.IN_HOSP != ''">
and a.IN_HOSP = #{udiwmsBasicSkPrescribeRequest.IN_HOSP}
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
and (a.STOOUT_NO like #{udiwmsBasicSkPrescribeRequest.key} || '%'
or a.PRESCRIBE_NUMBER like #{udiwmsBasicSkPrescribeRequest.key} || '%'
)
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
and (a.STOOUT_NO like concat( #{udiwmsBasicSkPrescribeRequest.key}
, '%')
or a.PRESCRIBE_NUMBER like concat( #{udiwmsBasicSkPrescribeRequest.key}
, '%')
)
</if>
</where>
GROUP BY
a.PRESCRIBE_NUMBER
<!-- <choose>-->
<!-- <when test="udiwmsBasicSkPrescribeRequest.IN_HOSP == '1'">-->
<!-- PRESCRIBE_NUMBER-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- STOOUT_NO-->
<!-- </otherwise>-->
<!-- </choose>-->
ORDER BY
a.PRESCRIBE_NUMBER
</select>
</mapper>

@ -23,78 +23,79 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
APPLY_NO, SICK_ID, STORAGE_CODE, DEPT_NAME, KEEP_BOOK_TIME, KEEP_BOOK_OPERATOR, SETTLE_NO,
PHYSIC_CODE, PHYSIC_NAME, PHYSIC_SPEC, QUANTITY, PHYSIC_UNIT, PRICE, COST, BATCH_NUMBER,
APPLY_NO, SICK_ID, STORAGE_CODE, DEPT_NAME, KEEP_BOOK_TIME, KEEP_BOOK_OPERATOR, SETTLE_NO,
PHYSIC_CODE, PHYSIC_NAME, PHYSIC_SPEC, QUANTITY, PHYSIC_UNIT, PRICE, COST, BATCH_NUMBER,
FEE_SEQUENCE_NO
</sql>
<select id="selectGroupedWithPagination" resultType="com.glxp.mipsdl.entity.ctqyy.VYpzsPresInfoReturn">
SELECT APPLY_NO
FROM v_ypzs_pres_info_return
<where>
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle' ">
<![CDATA[
and SEL_RETN_TIME >= TO_DATE(#{udiwmsBasicSkPrescribeRequest.startTime}
SELECT APPLY_NO
FROM v_ypzs_pres_info_return
<where>
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
<![CDATA[
and KEEP_BOOK_TIME >= TO_DATE(#{udiwmsBasicSkPrescribeRequest.startTime}
, 'YYYY-MM-DD HH24:MI:SS')
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle' ">
<![CDATA[
and SEL_RETN_TIME <= TO_DATE(#{udiwmsBasicSkPrescribeRequest.endTime}
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
<![CDATA[
and KEEP_BOOK_TIME <= TO_DATE(#{udiwmsBasicSkPrescribeRequest.endTime}
, 'YYYY-MM-DD HH24:MI:SS')
]]>
</if>
</if>
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL' ">
<![CDATA[
and SEL_RETN_TIME >= #{udiwmsBasicSkPrescribeRequest.startTime}
<if test="udiwmsBasicSkPrescribeRequest.startTime != null and udiwmsBasicSkPrescribeRequest.startTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
<![CDATA[
and KEEP_BOOK_TIME >= #{udiwmsBasicSkPrescribeRequest.startTime}
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL' ">
<![CDATA[
and SEL_RETN_TIME <= #{udiwmsBasicSkPrescribeRequest.endTime}
</if>
<if test="udiwmsBasicSkPrescribeRequest.endTime != null and udiwmsBasicSkPrescribeRequest.endTime != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
<![CDATA[
and KEEP_BOOK_TIME <= #{udiwmsBasicSkPrescribeRequest.endTime}
]]>
</if>
<if test="udiwmsBasicSkPrescribeRequest.code != null and udiwmsBasicSkPrescribeRequest.code != ''">
and (APPLY_NO = #{udiwmsBasicSkPrescribeRequest.code})
</if>
<if test="udiwmsBasicSkPrescribeRequest.fromCorpName != null and udiwmsBasicSkPrescribeRequest.fromCorpName != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle' ">
and (PSN_NAME like '%' || #{udiwmsBasicSkPrescribeRequest.fromCorpName} || '%' )
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle' ">
and (APPLY_NO like '%' || #{udiwmsBasicSkPrescribeRequest.key} || '%'
or PSN_NAME like '%' ||#{udiwmsBasicSkPrescribeRequest.key} || '%'
or PSN_NO like '%' || #{udiwmsBasicSkPrescribeRequest.key} ||'%'
)
</if>
<if test="udiwmsBasicSkPrescribeRequest.fromCorpName != null and udiwmsBasicSkPrescribeRequest.fromCorpName != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL' ">
and (PSN_NAME like concat('%', #{udiwmsBasicSkPrescribeRequest.key}, '%')
</if>
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL' ">
and (APPLY_NO like concat('%', #{udiwmsBasicSkPrescribeRequest.key}, '%')
or PSN_NAME like concat('%', #{udiwmsBasicSkPrescribeRequest.key}, '%')
or PSN_NO like concat('%', #{udiwmsBasicSkPrescribeRequest.key}, '%')
)
</if>
</where>
GROUP BY
APPLY_NO
ORDER BY
APPLY_NO
<if test="udiwmsBasicSkPrescribeRequest.code != null and udiwmsBasicSkPrescribeRequest.code != ''">
and ( APPLY_NO = #{udiwmsBasicSkPrescribeRequest.code}
or LAYPHYSIC_NO = #{udiwmsBasicSkPrescribeRequest.code}
or PRESCRIBE_NUMBER = #{udiwmsBasicSkPrescribeRequest.code}
)
</if>
<if test="udiwmsBasicSkPrescribeRequest.IN_HOSP != null and udiwmsBasicSkPrescribeRequest.IN_HOSP != ''">
and IO_TYPE = #{udiwmsBasicSkPrescribeRequest.IN_HOSP}
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'Oracle'">
and (APPLY_NO like #{udiwmsBasicSkPrescribeRequest.key} || '%'
or LAYPHYSIC_NO like #{udiwmsBasicSkPrescribeRequest.key} || '%'
)
</if>
<if test="udiwmsBasicSkPrescribeRequest.key != null and udiwmsBasicSkPrescribeRequest.key != ''
and udiwmsBasicSkPrescribeRequest.databaseProductName == 'MySQL'">
and (APPLY_NO like concat( #{udiwmsBasicSkPrescribeRequest.key}
, '%')
or LAYPHYSIC_NO like concat( #{udiwmsBasicSkPrescribeRequest.key}
, '%')
)
</if>
</where>
GROUP BY
APPLY_NO
<!-- <choose>-->
<!-- <when test="udiwmsBasicSkPrescribeRequest.IN_HOSP == '1'">-->
<!-- PRESCRIBE_NUMBER-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- STOOUT_NO-->
<!-- </otherwise>-->
<!-- </choose>-->
ORDER BY
APPLY_NO
</select>
</mapper>
</mapper>

Loading…
Cancel
Save