|
|
|
<?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.udidl.admin.dao.udplat.UdplatGoodsMatchMapper">
|
|
|
|
<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="deliveryGoodId" jdbcType="VARCHAR" property="deliveryGoodId" />
|
|
|
|
<result column="medicalCode" jdbcType="VARCHAR" property="medicalCode" />
|
|
|
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
</resultMap>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
delete from udplat_goods_match
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</delete>
|
|
|
|
<insert id="insert" parameterType="com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch">
|
|
|
|
insert into udplat_goods_match (id, deviceRecordKey, deliveryGoodId,
|
|
|
|
medicalCode, createTime
|
|
|
|
)
|
|
|
|
values (#{id,jdbcType=INTEGER}, #{deviceRecordKey,jdbcType=VARCHAR}, #{deliveryGoodId,jdbcType=VARCHAR},
|
|
|
|
#{medicalCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.glxp.udidl.admin.entity.udplat.UdplatGoodsMatch">
|
|
|
|
update udplat_goods_match
|
|
|
|
set deviceRecordKey = #{deviceRecordKey,jdbcType=VARCHAR},
|
|
|
|
<if test="deliveryGoodId != null and deliveryGoodId !='' ">
|
|
|
|
deliveryGoodId = #{deliveryGoodId,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="medicalCode != null and medicalCode !='' ">
|
|
|
|
medicalCode = #{medicalCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP}
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</update>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
select id, deviceRecordKey, deliveryGoodId, medicalCode, createTime, updateTime
|
|
|
|
from udplat_goods_match
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</select>
|
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
|
|
select id, deviceRecordKey, deliveryGoodId, medicalCode, createTime, updateTime
|
|
|
|
from udplat_goods_match
|
|
|
|
</select>
|
|
|
|
<select id="selectByDeviceRecordKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
select id, deviceRecordKey, deliveryGoodId, 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.deliveryGoodId,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},'%')
|
|
|
|
</if>
|
|
|
|
<if test="goodsMatchType == 1">
|
|
|
|
and m.deliveryGoodId is not null and m.deliveryGoodId != ''
|
|
|
|
</if>
|
|
|
|
<if test="goodsMatchType == 2">
|
|
|
|
and (m.deliveryGoodId is null or m.deliveryGoodId = '')
|
|
|
|
</if>
|
|
|
|
<if test="medicalMatchType == 1">
|
|
|
|
and m.medicalCode is not null and m.medicalCode != ''
|
|
|
|
</if>
|
|
|
|
<if test="medicalMatchType == 2">
|
|
|
|
and (m.medicalCode is null or m.medicalCode = '')
|
|
|
|
</if>
|
|
|
|
<if test="startDate != '' and startDate != null">
|
|
|
|
and p.updateTime >= #{startDate}
|
|
|
|
</if>
|
|
|
|
<if test="endDate != '' and endDate != null">
|
|
|
|
and p.updateTime <= #{endDate}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getMatchList" parameterType="java.lang.String" resultType="com.glxp.udidl.admin.dto.device.ProductGoodsMatchModel">
|
|
|
|
select p.*,m.deliveryGoodId,m.medicalCode from productinfo as p
|
|
|
|
left join udplat_goods_match as m on p.deviceRecordKey = m.deviceRecordKey where p.uuid=#{uuid}
|
|
|
|
</select>
|
|
|
|
</mapper>
|