You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
4.2 KiB
XML
79 lines
4.2 KiB
XML
<?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="projectGoodsCode" jdbcType="VARCHAR" property="projectGoodsCode" />
|
|
<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, projectGoodsCode,
|
|
medicalCode, createTime
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{deviceRecordKey,jdbcType=VARCHAR}, #{projectGoodsCode,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="projectGoodsCode != null and projectGoodsCode !='' ">
|
|
projectGoodsCode = #{projectGoodsCode,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, projectGoodsCode, 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
|
|
from udplat_goods_match
|
|
</select>
|
|
<select id="selectByDeviceRecordKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select id, deviceRecordKey, projectGoodsCode, 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
|
|
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 != ''
|
|
</if>
|
|
<if test="goodsMatchType == 2">
|
|
and (m.projectGoodsCode is null or m.projectGoodsCode = '')
|
|
</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.projectGoodsCode,m.medicalCode from productinfo as p
|
|
left join udplat_goods_match as m on p.deviceRecordKey = m.deviceRecordKey where p.uuid=#{uuid}
|
|
</select>
|
|
</mapper> |