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.
92 lines
3.7 KiB
XML
92 lines
3.7 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.udi.admin.dao.contrast.CustomercontrastDao">
|
|
|
|
|
|
<insert id="insertCustomercontrast" keyProperty="id"
|
|
parameterType="com.glxp.udi.admin.entity.contrast.CustomercontrastEntity">
|
|
replace INTO customer_contrast
|
|
(codeContrastId,userId,customerId)
|
|
values
|
|
(
|
|
#{codeContrastId},
|
|
#{userId},
|
|
#{customerId}
|
|
)
|
|
</insert>
|
|
|
|
|
|
<insert id="insertCustomercontrastList" keyProperty="id"
|
|
parameterType="com.glxp.udi.admin.entity.contrast.CustomercontrastEntity">
|
|
replace INTO customer_contrast
|
|
(codeContrastId,userId,customerId)
|
|
VALUES
|
|
<foreach collection="customercontrastEntities" item="item" index="index"
|
|
separator=",">
|
|
(
|
|
#{item.codeContrastId},
|
|
#{item.userId},
|
|
#{item.customerId}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteCustomercontrast" parameterType="com.glxp.udi.admin.req.contrast.DeleteCustomerContrastRequest">
|
|
delete from customer_contrast where customerId = #{customerId} and codeContrastId = #{codeContrastId}
|
|
</delete>
|
|
|
|
<select id="selectByCustomerId" parameterType="java.lang.Long" resultType="com.glxp.udi.admin.entity.contrast.CustomercontrastEntity">
|
|
select * FROM customer_contrast WHERE customerId = #{customerId}
|
|
</select>
|
|
|
|
<select id="filterDetailByCustomerId" parameterType="com.glxp.udi.admin.req.contrast.FilterCodeContrastRequest" resultType="com.glxp.udi.admin.entity.contrast.CodeContrastDetailEntity">
|
|
select customer_contrast.codeContrastId,druginfo.coName,druginfo.authCode,druginfo.packRatio,druginfo.packLevel,
|
|
druginfo.unit,code_contrast.drugCode,code_contrast.saleCode,code_contrast.isOldSale
|
|
from druginfo
|
|
INNER JOIN code_contrast on druginfo.nameCode = code_contrast.drugCode
|
|
INNER JOIN customer_contrast on code_contrast.id = customer_contrast.codeContrastId
|
|
|
|
<where>
|
|
<if test="coName != null and coName != ''">
|
|
and druginfo.coName like concat('%',#{coName},'%')
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
and druginfo.unit like concat(#{unit},'%')
|
|
</if>
|
|
<if test="nameCode != null and nameCode != ''">
|
|
and druginfo.nameCode like concat(#{nameCode},'%')
|
|
</if>
|
|
<if test="customerId != null and customerId != ''">
|
|
and customer_contrast.customerId = #{customerId}
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="filterDetailAll" parameterType="com.glxp.udi.admin.req.contrast.FilterCodeContrastRequest" resultType="com.glxp.udi.admin.entity.contrast.CodeContrastDetailEntity">
|
|
select code_contrast.id,druginfo.coName,druginfo.authCode,druginfo.packRatio,druginfo.packLevel,
|
|
druginfo.unit,code_contrast.drugCode,code_contrast.saleCode,code_contrast.isOldSale
|
|
from druginfo
|
|
INNER JOIN code_contrast on druginfo.nameCode = code_contrast.drugCode
|
|
|
|
<where>
|
|
<if test="coName != null and coName != ''">
|
|
and druginfo.coName like concat('%',#{coName},'%')
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
and druginfo.unit like concat(#{unit},'%')
|
|
</if>
|
|
<if test="nameCode != null and nameCode != ''">
|
|
and druginfo.nameCode like concat(#{nameCode},'%')
|
|
</if>
|
|
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|