@ -4,7 +4,7 @@
<resultMap id= "BaseResultMap" type= "com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch" >
<id column= "id" jdbcType= "INTEGER" property= "id" />
<result column= "deviceRecordKey" jdbcType= "VARCHAR" property= "deviceRecordKey" />
<result column= " projectGoodsCode" jdbcType= "VARCHAR" property= "projectGoodsCode " />
<result column= " deliveryGoodsId" jdbcType= "VARCHAR" property= "deliveryGoodsId " />
<result column= "medicalCode" jdbcType= "VARCHAR" property= "medicalCode" />
<result column= "createTime" jdbcType= "TIMESTAMP" property= "createTime" />
<result column= "updateTime" jdbcType= "TIMESTAMP" property= "updateTime" />
@ -14,10 +14,10 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id= "insert" parameterType= "com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch" >
insert into udplat_goods_match (id, deviceRecordKey, projectGoodsCode ,
insert into udplat_goods_match (id, deviceRecordKey, deliveryGoodsId ,
medicalCode, createTime
)
values (#{id,jdbcType=INTEGER}, #{deviceRecordKey,jdbcType=VARCHAR}, #{projectGoodsCode ,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{deviceRecordKey,jdbcType=VARCHAR}, #{deliveryGoodsId ,jdbcType=VARCHAR},
#{medicalCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
@ -25,7 +25,7 @@
update udplat_goods_match
set deviceRecordKey = #{deviceRecordKey,jdbcType=VARCHAR},
<if test= "projectGoodsCode != null and projectGoodsCode !='' " >
projectGoodsCode = #{projectGoodsCode ,jdbcType=VARCHAR},
projectGoodsCode = #{deliveryGoodsId ,jdbcType=VARCHAR},
</if>
<if test= "medicalCode != null and medicalCode !='' " >
medicalCode = #{medicalCode,jdbcType=VARCHAR},
@ -34,30 +34,30 @@
where id = #{id,jdbcType=INTEGER}
</update>
<select id= "selectByPrimaryKey" parameterType= "java.lang.Integer" resultMap= "BaseResultMap" >
select id, deviceRecordKey, projectGoodsCode , medicalCode, createTime, updateTime
select id, deviceRecordKey, deliveryGoodsId , medicalCode, createTime, updateTime
from udplat_goods_match
where id = #{id,jdbcType=INTEGER}
</select>
<select id= "selectAll" resultMap= "BaseResultMap" >
select id, deviceRecordKey, projectGoodsCode , medicalCode, createTime, updateTime
select id, deviceRecordKey, deliveryGoodsId , medicalCode, createTime, updateTime
from udplat_goods_match
</select>
<select id= "selectByDeviceRecordKey" parameterType= "java.lang.String" resultMap= "BaseResultMap" >
select id, deviceRecordKey, projectGoodsCode , medicalCode, createTime, updateTime
select id, deviceRecordKey, deliveryGoodsId , medicalCode, createTime, updateTime
from udplat_goods_match
where deviceRecordKey = #{id}
</select>
<select id= "getList" parameterType= "com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchParam" resultType= "com.glxp.udidl.admin.dto.udplat.UdplatGoodsMatchListModel" >
select p.uuid, p.nameCode,p.ylqxzcrbarmc, p.cpmctymc,p.ggxh,p.cpms,p.deviceRecordKey,m.projectGoodsCode ,m.medicalCode from productinfo as p
select p.uuid, p.nameCode,p.ylqxzcrbarmc,p.zczbhhzbapzbh, p.cpmctymc,p.ggxh,p.cpms,p.deviceRecordKey,m.deliveryGoodsId ,m.medicalCode from productinfo as p
left join udplat_goods_match as m on p.deviceRecordKey = m.deviceRecordKey where p.isNewest =1 and p.diType=1
<if test= "name != null and name != ''" >
and (p.cpmctymc like concat(#{name},'%') or p.ylqxzcrbarmc like concat(#{name},'%'))
</if>
<if test= "goodsMatchType == 1" >
and m.projectGoodsCode is not null and m.projectGoodsCode != ''
and m.deliveryGoodsId is not null and m.deliveryGoodsId != ''
</if>
<if test= "goodsMatchType == 2" >
and (m.projectGoodsCode is null or m.projectGoodsCode = '')
and (m.deliveryGoodsId is null or m.deliveryGoodsId = '')
</if>
<if test= "medicalMatchType == 1" >
and m.medicalCode is not null and m.medicalCode != ''
@ -73,7 +73,7 @@
</if>
</select>
<select id= "getMatchList" parameterType= "java.lang.String" resultType= "com.glxp.udidl.admin.dto.device.ProductGoodsMatchModel" >
select p.*,m.projectGoodsCode ,m.medicalCode from productinfo as p
select p.*,m.deliveryGoodsId ,m.medicalCode from productinfo as p
left join udplat_goods_match as m on p.deviceRecordKey = m.deviceRecordKey where p.uuid=#{uuid}
</select>
</mapper>