解决优化sql跑不起来的问题

加上无码表 和字段增加
dev_drug_dm
qiuyt 3 weeks ago
parent 3eb20a6b6a
commit 3ffada8113

@ -0,0 +1,9 @@
package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.YbNotCode;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface YbNotCodeMapper extends BaseMapper<YbNotCode> {
}

@ -0,0 +1,32 @@
package com.glxp.api.entity.basic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
*
*/
@Data
@TableName(value = "yb_not_code")
public class YbNotCode {
/**
*
*/
@TableId(value = "ybbm", type = IdType.INPUT)
private String ybbm;
/**
*
*/
@TableField(value = "organizationCode")
private String organizationcode;
/**
* 1 5 6 7 0
*/
@TableField(value = "notCodeType")
private Integer notcodetype;
}

@ -0,0 +1,8 @@
package com.glxp.api.service.basic;
import com.glxp.api.entity.basic.YbNotCode;
import com.baomidou.mybatisplus.extension.service.IService;
public interface YbNotCodeService extends IService<YbNotCode>{
}

@ -0,0 +1,12 @@
package com.glxp.api.service.basic.impl;
import com.glxp.api.service.basic.YbNotCodeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.basic.YbNotCode;
import com.glxp.api.dao.basic.YbNotCodeMapper;
@Service
public class YbNotCodeServiceImpl extends ServiceImpl<YbNotCodeMapper, YbNotCode> implements YbNotCodeService {
}

@ -0,0 +1,15 @@
<?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.basic.YbNotCodeMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.YbNotCode">
<!--@mbg.generated-->
<!--@Table yb_not_code-->
<id column="ybbm" jdbcType="VARCHAR" property="ybbm" />
<result column="organizationCode" jdbcType="VARCHAR" property="organizationcode" />
<result column="notCodeType" jdbcType="TINYINT" property="notcodetype" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
ybbm, organizationCode, notCodeType
</sql>
</mapper>

@ -262,12 +262,16 @@
resultType="java.lang.Integer">
SELECT count(*)
FROM sup_product
inner join sup_companyon sup_product.customerId = sup_company.customerId
INNER JOIN sup_manufactureron sup_manufacturer.manufacturerId =sup_product.manufacturerIdFk
WHERE sup_manufacturer.companyName = (SELECT companyName FROM sup_manufacturer WHERE manufacturerId = #{manufacturerIdFk} limit 1)
and recordCode = #{recordCode}
and recordProductName = #{recordProductName}
and sup_product.customerId = #{customerId}
inner join sup_company
on sup_product.customerId = sup_company.customerId
INNER JOIN sup_manufacturer
on sup_manufacturer.manufacturerId =
sup_product.manufacturerIdFk
WHERE sup_manufacturer.companyName =
(SELECT companyName FROM sup_manufacturer WHERE manufacturerId = #{manufacturerIdFk})
and recordCode = #{recordCode}
and recordProductName = #{recordProductName}
and sup_product.customerId = #{customerId}
</select>
<delete id="deleteById" parameterType="Map">
DELETE

@ -1318,3 +1318,26 @@ CALL Modify_index('rel_code_detail', 'curCode', 'rel_code_detail_parentCode', 'B
CALL Modify_index('rel_code_batch', 'productCode', 'rel_code_batch_productCode', 'BTREE');
CALL Modify_index('rel_code_batch', 'curCode', 'rel_code_batch_curCode', 'BTREE');
CALL Modify_index('rel_code_batch', 'packageSpec', 'rel_code_batch_packageSpec', 'BTREE');
CALL Pro_Temp_ColumnWork('basic_udirel', 'notCodeType',
' tinyint NULL DEFAULT b''0''COMMENT ''无码类型''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPrice',
' decimal(10, 2) DEFAULT NULL COMMENT ''药品售价''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'drugSellingPriceTime',
' datetime DEFAULT NULL COMMENT ''药品售价''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'hangingNetType',
' tinyint DEFAULT NULL COMMENT ''是否挂网''',
1);
CREATE TABLE IF NOT EXISTS `yb_not_code` (
`ybbm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '国家医保目录编码',
`organizationCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构编码',
`notCodeType` tinyint DEFAULT NULL COMMENT '无码类型 1、部分早期未赋予追溯码 5、最小包装无追溯码 6、无追溯码 7、其他原因 0、默认不是无码类型',
PRIMARY KEY (`ybbm`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='医保无码信息表';

Loading…
Cancel
Save