3/4 dev/idc 补充basic 优化1.0

dev_drug_dm
wangwei 1 month ago
parent 8f4ff09767
commit 79d545a5ba

@ -28,7 +28,6 @@ public interface UdiProductDao extends BaseMapperPlus<UdiProductDao, UdiProductE
boolean insertUdiInfo(UdiProductEntity udiProductEntity);
boolean insertUdiInfos(@Param("udiInfoEntities") List<UdiProductEntity> udiInfoEntities);
/**
* nameCode
@ -54,10 +53,6 @@ public interface UdiProductDao extends BaseMapperPlus<UdiProductDao, UdiProductE
*/
List<UdiProductEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest);
/**
*
*
@ -76,11 +71,4 @@ public interface UdiProductDao extends BaseMapperPlus<UdiProductDao, UdiProductE
boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest);
/**
* DI
*
* @param nameCode
* @return
*/
UdiProductEntity selectAllowNoBatch(@Param("nameCode") String nameCode);
}

@ -24,7 +24,6 @@ public interface DeviceInfoMapper extends BaseMapperPlus<DeviceInfoMapper,Device
List<DeviceInfoVo> detail(@Param("param") DeviceInfoDetailByDeptCodeQuery query);
List<DeviceInfoVo> listVoByProductIdAndStatus(@Param("productId")Long productId, @Param("status")DeviceStatusEnum status);
List<DeviceInfoVo> listVoByCodes(@Param("list") List<String> deviceCodes,@Param("deptCode") String deptCode,@Param("status") List<DeviceStatusEnum> status);
}

@ -21,32 +21,10 @@ public interface DbDao {
List<Map<String,Object>> list(Map<String,Object> map);
int count(Map<String,Object> map);
@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables"
+ " where table_schema = (select database())")
List<Map<String, Object>> listMysql();
@Select("select tname as \"tableName\",'oracle' as \"engine\",tname as \"tableComment\",sysdate as \"createTime\" from tab where instr('BIN,ACT',substr(tname,1,3))<1")
List<Map<String, Object>> listOracle();
@Select("select name tableName, 'sqlserver' engine, name tableComment, crdate createTime from SYSOBJECTS"
+ " WHERE XTYPE='U' ORDER BY NAME")
List<Map<String, Object>> listSqlserver();
@Select("select count(*) from information_schema.tables where table_schema = (select database())")
int countMysql(Map<String, Object> map);
@Select("select count(*) from tab where tabtype='TABLE' and instr('BIN,ACT',substr(tname,1,3))<1")
int countOracle(Map<String, Object> map);
@Select("select count(*) from SYSOBJECTS where XTYPE='U'")
int countSqlserver(Map<String, Object> map);
@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables \r\n"
+ " where table_schema = (select database()) and lower(table_name) = lower(#{tableName})")
Map<String, String> getMysql(String tableName);
@Select("select tname as \"tableName\",'oracle' \"engine\",tname \"tableComment\",sysdate \"createTime\" from tab \r\n"
+ " where tname= upper(#{tableName})")
Map<String, String> getOracle(String tableName);
@Select("select name tableName, 'sqlserver' engine, name tableComment, crdate createTime from SYSOBJECTS"
+ " WHERE lower(name)=lower(#{tableName})")
Map<String, String> getSqlserver(String tableName);
@Select("select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra as extra,table_name tableName, "
+ "concat('(',if(NUMERIC_PRECISION>0,CONVERT(NUMERIC_PRECISION,CHAR),''),if(NUMERIC_SCALE>0,concat(',',CONVERT(NUMERIC_SCALE,CHAR)),''),if(CHARACTER_MAXIMUM_LENGTH>0,CONVERT(CHARACTER_MAXIMUM_LENGTH,CHAR),''),')') as width "
+ " from information_schema.columns\r\n"
@ -57,23 +35,4 @@ public interface DbDao {
+ " from information_schema.columns\r\n"
+ " where lower(table_name) = lower(#{tableName}) and column_key='PRI' and table_schema = (select database()) order by ordinal_position")
List<Map<String, String>> listKeyMysql(String tableName);
@Select("select cname as \"columnName\",coltype as \"dataType\",cname \"columnComment\",'' as \"columnKey\",'' as \"extra\",tname \"tableName\", "
+" '('||decode(sign(PRECISION),1,to_char(PRECISION),'')||decode(sign(SCALE),1,','||to_char(SCALE),'')||decode(sign(PRECISION),1,'',decode(sign(SCALE),1,'',to_char(width)))||')' as width "
+ "from col \r\n"
+" where tname = upper(#{tableName}) order by colno")
List<Map<String, String>> listColumnsOracle(String tableName);
@Select("select syscolumns.name columnName, systypes.name as dataType, syscolumns.name columnComment, \r\n"
+"(select 'PRI' from sysindexkeys,sysobjects,sysindexes where sysindexkeys.id=syscolumns.id and sysindexkeys.colid=syscolumns.colid \r\n"
+" and sysindexkeys.id=syscolumns.id and sysindexes.id=syscolumns.id and sysindexkeys.indid=sysindexes.indid and sysobjects.name=sysindexes.name and sysobjects.xtype='PK'"
+") columnKey,'' extra,#{tableName} tableName, "
+"'('+case when syscolumns.xprec>0 then cast(syscolumns.xprec as varchar) else '' end + case when syscolumns.xscale>0 then ','+cast(syscolumns.xscale as varchar) else '' end +case when syscolumns.xscale>0 or syscolumns.xprec>0 then '' else cast(syscolumns.length as varchar) end +')' as width "
+ " from syscolumns,\r\n"
+ " systypes"
+ " where syscolumns.xtype=systypes.xtype and syscolumns.id = OBJECT_ID(#{tableName}) order by syscolumns.colid")
List<Map<String, String>> listColumnsSqlserver(String tableName);
@Select("select c.column_name as \"columnName\" from user_constraints con,user_cons_columns c where con.constraint_name=c.constraint_name and con.constraint_type='P' and c.table_name=upper(#{tableName})")
List<Map<String, String>> listKeyOracle(String tableName);
}

@ -28,117 +28,6 @@
</where>
</select>
<select id="filterUdiInfo2" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
SELECT basic_products.id,
basic_udirel.thirdId,
basic_udirel.thirdName,
basic_udirel.isUseDy,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.ybbm,
basic_udirel.sptm,
basic_udirel.isDisable,
basic_udirel.thirdName1,
basic_udirel.thirdName2,
basic_udirel.thirdName3,
basic_udirel.thirdName4,
basic_udirel.manufactory,
basic_udirel.measname,
basic_udirel.udplatCode,
basic_products.nameCode,
basic_products.packRatio,
basic_products.packLevel,
basic_products.packUnit,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.addType,
basic_products.deviceRecordKey,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.uuid,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.originUuid,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
basic_products.cphhhbh,
basic_products.hchzsb
FROM (company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id)
inner JOIN basic_products
ON basic_udirel.uuid = basic_products.uuid
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
or nameCode LIKE concat('%', #{unionCode}, '%')
or basic_udirel.ybbm LIKE concat('%', #{unionCode}, '%')
or basic_udirel.sptm LIKE concat('%', #{unionCode}, '%')
</if>
<if test="thrPiId != '' and thrPiId != null">
or thirdId LIKE concat('%', #{thrPiId}, '%')
or thirdId1 LIKE concat('%', #{thrPiId}, '%')
or thirdId2 LIKE concat('%', #{thrPiId}, '%')
or thirdId3 LIKE concat('%', #{thrPiId}, '%')
or thirdId4 LIKE concat('%', #{thrPiId}, '%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.customerId = #{customerId}
</if>
<if test="originUuid != '' and originUuid != null">
AND originUuid = #{originUuid}
</if>
</where>
ORDER BY updateTime DESC
</select>
<!--// AND company_product_relevance.auditStatus = 1-->
<select id="findById" parameterType="java.lang.String"
resultType="com.glxp.api.entity.basic.UdiProductEntity">
@ -215,79 +104,6 @@
#{requireScanCode})
</insert>
<insert id="insertUdiInfos" parameterType="java.util.List">
replace INTO basic_products
(id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl,
zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm,
ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, sjcpbm, versionNumber, diType, ybbm, sptm,
manufactory, measname, productType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms,
allowNoBatch, allowNoExpire,
allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2,
basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7,
basicPrductRemak8, updateTime, sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj,
mjfs, categoryName, pinyinInitial, xjdw, detailSort)
values
<foreach collection="udiInfoEntities" item="item" index="index"
separator=",">
(#{item.id},
#{item.uuid},
#{item.originUuid},
#{item.nameCode},
#{item.deviceRecordKey},
#{item.packRatio},
#{item.packLevel},
#{item.packUnit},
#{item.bhxjsl},
#{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl},
#{item.bhxjcpbm},
#{item.bzcj},
#{item.cpmctymc},
#{item.cplb},
#{item.flbm},
#{item.ggxh},
#{item.qxlb},
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},
#{item.ylqxzcrbarywmc},
#{item.sydycpbs},
#{item.sjcpbm},
#{item.versionNumber},
#{item.diType},
#{item.ybbm},
#{item.sptm},
#{item.manufactory},
#{item.measname},
#{item.productType},
#{item.scbssfbhph},
#{item.scbssfbhxlh},
#{item.scbssfbhscrq},
#{item.scbssfbhsxrq},
#{item.cpms},
#{item.allowNoBatch},
#{item.allowNoExpire},
#{item.allowNoProduct}, #{item.allowNoSerial},
#{item.spmc},
#{item.cplx},
#{item.hchzsb},
#{item.cpdls},
#{item.price},
#{item.basicPrductRemak1},
#{item.basicPrductRemak2},
#{item.basicPrductRemak3},
#{item.basicPrductRemak4},
#{item.basicPrductRemak5},
#{item.basicPrductRemak6},
#{item.basicPrductRemak7},
#{item.basicPrductRemak8}, #{item.updateTime}, #{item.sfwblztlcp}, #{item.cgzmraqxgxx}, #{item.sfbjwycxsy},
#{item.zdcfsycs},
#{item.sfwwjbz}, #{item.syqsfxyjxmj}, #{item.mjfs},
#{item.categoryName}, #{item.pinyinInitial}, #{item.xjdw}, #{item.detailSort})
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_products
@ -969,15 +785,6 @@
</foreach>
</select>
<select id="batchSelectByOriginUuid" resultType="com.glxp.api.entity.basic.UdiRelevanceEntity">
select *
from basic_products where originUuid in
<foreach collection="uuids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="selectPackLevel" resultType="java.lang.Integer">
select packLevel
from basic_products
@ -991,8 +798,6 @@
left join basic_udirel on basic_products.uuid = basic_udirel.uuid
where basic_udirel.id = #{relId}
</select>
<update id="updateUdiInfoNotAll" parameterType="com.glxp.api.req.basic.UdiInfoRequest">
UPDATE basic_products
<trim prefix="set" suffixOverrides=",">
@ -1181,10 +986,4 @@
WHERE uuid = #{uuid}
</update>
<select id="selectAllowNoBatch" resultType="com.glxp.api.entity.basic.UdiProductEntity">
select id, allowNoBatch
from basic_products
where nameCode = #{nameCode}
limit 1
</select>
</mapper>

@ -3,7 +3,6 @@
<mapper namespace="com.glxp.api.dao.collect.RelCodeDetailMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.collect.RelCodeDetail">
<!--@mbg.generated-->
<!--@Table udi_wms_ywj.rel_code_detail-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="curCode" jdbcType="VARCHAR" property="curCode"/>
<result column="packLayer" jdbcType="TINYINT" property="packLayer"/>

@ -0,0 +1,7 @@
<?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.dev.DeviceCheckItemDictMapper">
</mapper>

@ -100,18 +100,6 @@
</where>
order by info.deviceCode
</select>
<select id="listVoByProductIdAndStatus" resultType="com.glxp.api.vo.dev.DeviceInfoVo">
select info.*,
dept.name deptName
from device_info info
left join auth_dept dept on dept.code = info.deptCode
where productId = #{productId}
and info.status = #{status}
order by info.deptCode, info.deviceCode
</select>
<select id="listVoByCodes" resultType="com.glxp.api.vo.dev.DeviceInfoVo">
select info.*,
dept.name deptName

@ -0,0 +1,7 @@
<?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.dev.DeviceUpkeepDetailItemMapper">
</mapper>

@ -0,0 +1,7 @@
<?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.dev.DeviceUpkeepDetailMapper">
</mapper>
Loading…
Cancel
Save