229 lines
12 KiB
XML
229 lines
12 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.ruoyi.health.mapper.HealthMedicineBasicMapper">
|
|
|
|
<resultMap type="HealthMedicineBasicVo" id="HealthMedicineBasicResult">
|
|
<result property="id" column="id" />
|
|
<result property="name" column="name" />
|
|
<result property="classification" column="classification" />
|
|
<result property="category" column="category" />
|
|
<result property="brand" column="brand" />
|
|
<result property="packaging" column="packaging" />
|
|
<result property="manufacturers" column="manufacturers" />
|
|
<result property="treatmentType" column="treatment_type" />
|
|
<result property="isImport" column="is_import" />
|
|
<result property="ingredients" column="ingredients" />
|
|
<result property="usage" column="usage" />
|
|
<result property="dosageForm" column="dosage_form" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="remark" column="remark" />
|
|
<result property="code" column="code" />
|
|
<result property="specifications" column="specifications" />
|
|
<result property="unit" column="unit" />
|
|
<result property="adverseReaction" column="adverse_reaction" />
|
|
<result property="address" column="address" />
|
|
<result property="content" column="content" />
|
|
<result property="contentUnit" column="content_unit" />
|
|
<result property="character" column="character" />
|
|
<result property="storage" column="storage" />
|
|
<result property="indications" column="indications" />
|
|
<result property="shortName" column="short_name" />
|
|
<result property="packageUnit" column="package_unit" />
|
|
</resultMap>
|
|
|
|
<sql id="selectHealthMedicineBasicVo">
|
|
select
|
|
a.id,
|
|
a.name,
|
|
a.classification,
|
|
a.category,
|
|
a.brand,
|
|
a.packaging,
|
|
a.manufacturers,
|
|
a.treatment_type,
|
|
a.is_import,
|
|
a.ingredients,
|
|
a.usage,
|
|
a.dosage_form,
|
|
a.create_by,
|
|
a.create_time,
|
|
a.update_by,
|
|
a.update_time,
|
|
a.del_flag,
|
|
a.remark,
|
|
a.code,
|
|
a.specifications,
|
|
a.unit,
|
|
a.adverse_reaction,
|
|
a.address,
|
|
a.content,
|
|
a.content_unit,
|
|
a.character,
|
|
a.storage,
|
|
a.indications,
|
|
a.short_name,
|
|
a.package_unit
|
|
from
|
|
health_medicine_basic a
|
|
|
|
</sql>
|
|
|
|
<select id="selectHealthMedicineBasicList" parameterType="HealthMedicineBasicDto" resultMap="HealthMedicineBasicResult">
|
|
<include refid="selectHealthMedicineBasicVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
|
<if test="keys != null and keys != ''"> and a.name like '%'|| #{keys}||'%' or a.short_name like '%'|| #{keys}||'%' or a.brand like '%'|| #{keys}||'%' or a.manufacturers like '%'|| #{keys}||'%' or a.code like '%'|| #{keys}||'%'</if>
|
|
<if test="shortName != null and shortName != ''"> and a.short_name like '%'|| #{shortName}||'%'</if>
|
|
<if test="classification != null and classification != ''"> and a.classification = #{classification}</if>
|
|
<if test="category != null and category != ''"> and a.category = #{category}</if>
|
|
<if test="brand != null and brand != ''"> and a.brand like '%'|| #{brand}||'%'</if>
|
|
<if test="packaging != null and packaging != ''"> and a.packaging = #{packaging}</if>
|
|
<if test="manufacturers != null and manufacturers != ''"> and a.manufacturers like '%'|| #{manufacturers}||'%'</if>
|
|
<if test="treatmentType != null and treatmentType != ''"> and a.treatment_type = #{treatmentType}</if>
|
|
<if test="isImport != null and isImport != ''"> and a.is_import = #{isImport}</if>
|
|
<if test="ingredients != null and ingredients != ''"> and a.ingredients = #{ingredients}</if>
|
|
<if test="usage != null and usage != ''"> and a.usage = #{usage}</if>
|
|
<if test="dosageForm != null and dosageForm != ''"> and a.dosage_form = #{dosageForm}</if>
|
|
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectHealthMedicineBasicById" parameterType="Long" resultMap="HealthMedicineBasicResult">
|
|
<include refid="selectHealthMedicineBasicVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertHealthMedicineBasic" parameterType="HealthMedicineBasic">
|
|
insert into health_medicine_basic
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="classification != null and classification != ''">classification,</if>
|
|
<if test="category != null and category != ''">category,</if>
|
|
<if test="brand != null and brand != ''">brand,</if>
|
|
<if test="packaging != null and packaging != ''">packaging,</if>
|
|
<if test="manufacturers != null and manufacturers != ''">manufacturers,</if>
|
|
<if test="treatmentType != null and treatmentType != ''">treatment_type,</if>
|
|
<if test="isImport != null">is_import,</if>
|
|
<if test="ingredients != null">ingredients,</if>
|
|
<if test="usage != null">usage,</if>
|
|
<if test="dosageForm != null and dosageForm != ''">dosage_form,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="code != null and code != ''">code,</if>
|
|
<if test="specifications != null">specifications,</if>
|
|
<if test="unit != null">unit,</if>
|
|
<if test="adverseReaction != null">adverse_reaction,</if>
|
|
<if test="address != null">address,</if>
|
|
<if test="content != null">content,</if>
|
|
<if test="contentUnit != null">content_unit,</if>
|
|
<if test="character != null">character,</if>
|
|
<if test="storage != null">storage,</if>
|
|
<if test="indications != null">indications,</if>
|
|
<if test="shortName != null">short_name,</if>
|
|
<if test="packageUnit != null">package_unit,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="classification != null and classification != ''">#{classification},</if>
|
|
<if test="category != null and category != ''">#{category},</if>
|
|
<if test="brand != null and brand != ''">#{brand},</if>
|
|
<if test="packaging != null and packaging != ''">#{packaging},</if>
|
|
<if test="manufacturers != null and manufacturers != ''">#{manufacturers},</if>
|
|
<if test="treatmentType != null and treatmentType != ''">#{treatmentType},</if>
|
|
<if test="isImport != null">#{isImport},</if>
|
|
<if test="ingredients != null">#{ingredients},</if>
|
|
<if test="usage != null">#{usage},</if>
|
|
<if test="dosageForm != null and dosageForm != ''">#{dosageForm},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="code != null and code != ''">#{code},</if>
|
|
<if test="specifications != null">#{specifications},</if>
|
|
<if test="unit != null">#{unit},</if>
|
|
<if test="adverseReaction != null">#{adverseReaction},</if>
|
|
<if test="address != null">#{address},</if>
|
|
<if test="content != null">#{content},</if>
|
|
<if test="contentUnit != null">#{contentUnit},</if>
|
|
<if test="character != null">#{character},</if>
|
|
<if test="storage != null">#{storage},</if>
|
|
<if test="indications != null">#{indications},</if>
|
|
<if test="shortName != null">#{shortName},</if>
|
|
<if test="packageUnit != null">#{packageUnit},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHealthMedicineBasic" parameterType="HealthMedicineBasic">
|
|
update health_medicine_basic
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="classification != null and classification != ''">classification = #{classification},</if>
|
|
<if test="category != null and category != ''">category = #{category},</if>
|
|
<if test="brand != null and brand != ''">brand = #{brand},</if>
|
|
<if test="packaging != null and packaging != ''">packaging = #{packaging},</if>
|
|
<if test="manufacturers != null and manufacturers != ''">manufacturers = #{manufacturers},</if>
|
|
<if test="treatmentType != null and treatmentType != ''">treatment_type = #{treatmentType},</if>
|
|
<if test="isImport != null">is_import = #{isImport},</if>
|
|
<if test="ingredients != null">ingredients = #{ingredients},</if>
|
|
<if test="usage != null">usage = #{usage},</if>
|
|
<if test="dosageForm != null and dosageForm != ''">dosage_form = #{dosageForm},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
|
<if test="specifications != null">specifications = #{specifications},</if>
|
|
<if test="unit != null">unit = #{unit},</if>
|
|
<if test="adverseReaction != null">adverse_reaction = #{adverseReaction},</if>
|
|
<if test="address != null">address = #{address},</if>
|
|
<if test="content != null">content = #{content},</if>
|
|
<if test="contentUnit != null">content_unit = #{contentUnit},</if>
|
|
<if test="character != null">character = #{character},</if>
|
|
<if test="storage != null">storage = #{storage},</if>
|
|
<if test="indications != null">indications = #{indications},</if>
|
|
<if test="shortName != null">short_name = #{shortName},</if>
|
|
<if test="packageUnit != null">package_unit = #{packageUnit},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteHealthMedicineBasicById" parameterType="Long">
|
|
delete from health_medicine_basic where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteHealthMedicineBasicByIds" parameterType="String">
|
|
delete from health_medicine_basic where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<update id="removeHealthMedicineBasicById" parameterType="Long">
|
|
update health_medicine_basic set del_flag='1' where id = #{id}
|
|
</update>
|
|
|
|
<update id="removeHealthMedicineBasicByIds" parameterType="String">
|
|
update health_medicine_basic set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|