fix: 新功能开发,原有功能优化。
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
<?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.HealthActivityMapper">
|
||||
|
||||
<resultMap type="HealthActivityVo" id="HealthActivityResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="place" column="place" />
|
||||
<result property="activityVolume" column="activity_volume" />
|
||||
<result property="exerciseTime" column="exercise_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="harvest" column="harvest" />
|
||||
<result property="foods" column="foods" />
|
||||
<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="totalCost" column="total_cost" />
|
||||
<result property="partner" column="partner" />
|
||||
<result property="costDetail" column="cost_detail" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthActivityVo">
|
||||
select a.id, a.name, a.type, a.place, a.activity_volume, a.exercise_time, a.start_time, a.end_time, a.harvest, a.foods, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.total_cost, a.partner, a.cost_detail from health_activity a
|
||||
</sql>
|
||||
|
||||
<select id="selectHealthActivityList" parameterType="HealthActivityDto" resultMap="HealthActivityResult">
|
||||
<include refid="selectHealthActivityVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="place != null and place != ''"> and a.place = #{place}</if>
|
||||
<if test="activityVolume != null and activityVolume != ''"> and a.activity_volume = #{activityVolume}</if>
|
||||
<if test="startTime != null "> and a.start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and a.end_time = #{endTime}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectHealthActivityById" parameterType="Long" resultMap="HealthActivityResult">
|
||||
<include refid="selectHealthActivityVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthActivity" parameterType="HealthActivity">
|
||||
insert into health_activity
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="place != null">place,</if>
|
||||
<if test="activityVolume != null">activity_volume,</if>
|
||||
<if test="exerciseTime != null">exercise_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="harvest != null">harvest,</if>
|
||||
<if test="foods != null">foods,</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="totalCost != null">total_cost,</if>
|
||||
<if test="partner != null">partner,</if>
|
||||
<if test="costDetail != null">cost_detail,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="place != null">#{place},</if>
|
||||
<if test="activityVolume != null">#{activityVolume},</if>
|
||||
<if test="exerciseTime != null">#{exerciseTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="harvest != null">#{harvest},</if>
|
||||
<if test="foods != null">#{foods},</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="totalCost != null">#{totalCost},</if>
|
||||
<if test="partner != null">#{partner},</if>
|
||||
<if test="costDetail != null">#{costDetail},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthActivity" parameterType="HealthActivity">
|
||||
update health_activity
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="place != null">place = #{place},</if>
|
||||
<if test="activityVolume != null">activity_volume = #{activityVolume},</if>
|
||||
<if test="exerciseTime != null">exercise_time = #{exerciseTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="harvest != null">harvest = #{harvest},</if>
|
||||
<if test="foods != null">foods = #{foods},</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="totalCost != null">total_cost = #{totalCost},</if>
|
||||
<if test="partner != null">partner = #{partner},</if>
|
||||
<if test="costDetail != null">cost_detail = #{costDetail},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHealthActivityById" parameterType="Long">
|
||||
delete from health_activity where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHealthActivityByIds" parameterType="String">
|
||||
delete from health_activity where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeHealthActivityById" parameterType="Long">
|
||||
update health_activity set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeHealthActivityByIds" parameterType="String">
|
||||
update health_activity set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -2,9 +2,9 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.health.mapper.HealthWeightRecordMapper">
|
||||
<mapper namespace="com.ruoyi.health.mapper.HealthHeightWeightRecordMapper">
|
||||
|
||||
<resultMap type="HealthWeightRecordVo" id="HealthWeightRecordResult">
|
||||
<resultMap type="HealthHeightWeightRecordVo" id="HealthHeightWeightRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -15,18 +15,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="measureTime" column="measure_time" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="personId" column="person_id" />
|
||||
<result property="height" column="height" />
|
||||
<result property="personName" column="person_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthWeightRecordVo">
|
||||
select a.id, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.measure_time, a.weight, a.person_id from health_weight_record a
|
||||
<sql id="selectHealthHeightWeightRecordVo">
|
||||
select
|
||||
a.id,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.measure_time,
|
||||
a.weight,
|
||||
a.person_id,
|
||||
a.height,
|
||||
hp."name" as person_name
|
||||
from
|
||||
health_height_weight_record a
|
||||
left join health_person hp on
|
||||
hp.id = a.person_id
|
||||
</sql>
|
||||
|
||||
<select id="selectHealthWeightRecordList" parameterType="HealthWeightRecordDto" resultMap="HealthWeightRecordResult">
|
||||
<include refid="selectHealthWeightRecordVo"/>
|
||||
<select id="selectHealthHeightWeightRecordList" parameterType="HealthHeightWeightRecordDto" resultMap="HealthHeightWeightRecordResult">
|
||||
<include refid="selectHealthHeightWeightRecordVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="personId != null "> and a.person_id = #{personId}</if>
|
||||
<if test="measureTime != null "> and a.measure_time = #{measureTime}</if>
|
||||
<if test="weight != null "> and a.weight = #{weight}</if>
|
||||
<if test="personId != null and personId != ''"> and a.person_id = #{personId}</if>
|
||||
<if test="height != null "> and a.height = #{height}</if>
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.measure_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
@@ -39,13 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by a.measure_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectHealthWeightRecordById" parameterType="Long" resultMap="HealthWeightRecordResult">
|
||||
<include refid="selectHealthWeightRecordVo"/>
|
||||
<select id="selectHealthHeightWeightRecordById" parameterType="Long" resultMap="HealthHeightWeightRecordResult">
|
||||
<include refid="selectHealthHeightWeightRecordVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthWeightRecord" parameterType="HealthWeightRecord">
|
||||
insert into health_weight_record
|
||||
<insert id="insertHealthHeightWeightRecord" parameterType="HealthHeightWeightRecord">
|
||||
insert into health_height_weight_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@@ -57,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="measureTime != null">measure_time,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="personId != null">person_id,</if>
|
||||
<if test="height != null">height,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -69,11 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="measureTime != null">#{measureTime},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="personId != null">#{personId},</if>
|
||||
<if test="height != null">#{height},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthWeightRecord" parameterType="HealthWeightRecord">
|
||||
update health_weight_record
|
||||
<update id="updateHealthHeightWeightRecord" parameterType="HealthHeightWeightRecord">
|
||||
update health_height_weight_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
@@ -84,26 +106,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="measureTime != null">measure_time = #{measureTime},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="personId != null">person_id = #{personId},</if>
|
||||
<if test="height != null">height = #{height},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHealthWeightRecordById" parameterType="Long">
|
||||
delete from health_weight_record where id = #{id}
|
||||
<delete id="deleteHealthHeightWeightRecordById" parameterType="Long">
|
||||
delete from health_height_weight_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHealthWeightRecordByIds" parameterType="String">
|
||||
delete from health_weight_record where id in
|
||||
<delete id="deleteHealthHeightWeightRecordByIds" parameterType="String">
|
||||
delete from health_height_weight_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeHealthWeightRecordById" parameterType="Long">
|
||||
update health_weight_record set del_flag='1' where id = #{id}
|
||||
<update id="removeHealthHeightWeightRecordById" parameterType="Long">
|
||||
update health_height_weight_record set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeHealthWeightRecordByIds" parameterType="String">
|
||||
update health_weight_record set del_flag='1' where id in
|
||||
<update id="removeHealthHeightWeightRecordByIds" parameterType="String">
|
||||
update health_height_weight_record set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -20,6 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="personId" column="person_id" />
|
||||
<result property="resource" column="resource" />
|
||||
<result property="place" column="place" />
|
||||
<result property="medicineId" column="medicine_id" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="content" column="content" />
|
||||
<result property="contentUnit" column="content_unit" />
|
||||
<result property="personName" column="person_name" />
|
||||
<result property="healthRecordName" column="health_record_name" />
|
||||
|
||||
@@ -42,6 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.person_id,
|
||||
a.resource,
|
||||
a.place,
|
||||
a.place,
|
||||
a.medicine_id,
|
||||
a.unit,
|
||||
a.content,
|
||||
a.content_unit,
|
||||
hp."name" as person_name ,
|
||||
hr."name" as health_record_name
|
||||
from
|
||||
@@ -64,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="personId != null "> and a.person_id = #{personId}</if>
|
||||
<if test="resource != null and resource != ''"> and a.resource = #{resource}</if>
|
||||
<if test="place != null and place != ''"> and a.place = #{place}</if>
|
||||
<if test="medicineId != null">medicine_id = #{medicineId},</if>
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.dosing_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
@@ -99,6 +109,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="personId != null">person_id,</if>
|
||||
<if test="resource != null">resource,</if>
|
||||
<if test="place != null">place,</if>
|
||||
<if test="medicineId != null">medicine_id,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="contentUnit != null">content_unit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -116,6 +130,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="personId != null">#{personId},</if>
|
||||
<if test="resource != null">#{resource},</if>
|
||||
<if test="place != null">#{place},</if>
|
||||
<if test="medicineId != null">#{medicineId},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="contentUnit != null">#{contentUnit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -136,6 +154,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="personId != null">person_id = #{personId},</if>
|
||||
<if test="resource != null">resource = #{resource},</if>
|
||||
<if test="place != null">place = #{place},</if>
|
||||
<if test="medicineId != null">medicine_id = #{medicineId},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="contentUnit != null">content_unit = #{contentUnit},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
<?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="storage" column="indications" />
|
||||
</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 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="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 = #{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 = #{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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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.HealthMedicineRealtimeStockMapper">
|
||||
|
||||
<resultMap type="HealthMedicineRealtimeStockVo" id="HealthMedicineRealtimeStockResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="medicineId" column="medicine_id" />
|
||||
<result property="inventory" column="inventory" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthMedicineRealtimeStockVo">
|
||||
select a.id, a.medicine_id, a.inventory, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark from health_medicine_realtime_stock a
|
||||
</sql>
|
||||
|
||||
<select id="selectHealthMedicineRealtimeStockList" parameterType="HealthMedicineRealtimeStockDto" resultMap="HealthMedicineRealtimeStockResult">
|
||||
<include refid="selectHealthMedicineRealtimeStockVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="medicineId != null and medicineId != ''"> and a.medicine_id = #{medicineId}</if>
|
||||
<if test="inventory != null and inventory != ''"> and a.inventory = #{inventory}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectHealthMedicineRealtimeStockById" parameterType="String" resultMap="HealthMedicineRealtimeStockResult">
|
||||
<include refid="selectHealthMedicineRealtimeStockVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthMedicineRealtimeStock" parameterType="HealthMedicineRealtimeStock">
|
||||
insert into health_medicine_realtime_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="medicineId != null">medicine_id,</if>
|
||||
<if test="inventory != null">inventory,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="medicineId != null">#{medicineId},</if>
|
||||
<if test="inventory != null">#{inventory},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthMedicineRealtimeStock" parameterType="HealthMedicineRealtimeStock">
|
||||
update health_medicine_realtime_stock
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="medicineId != null">medicine_id = #{medicineId},</if>
|
||||
<if test="inventory != null">inventory = #{inventory},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHealthMedicineRealtimeStockById" parameterType="String">
|
||||
delete from health_medicine_realtime_stock where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHealthMedicineRealtimeStockByIds" parameterType="String">
|
||||
delete from health_medicine_realtime_stock where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeHealthMedicineRealtimeStockById" parameterType="String">
|
||||
update health_medicine_realtime_stock set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeHealthMedicineRealtimeStockByIds" parameterType="String">
|
||||
update health_medicine_realtime_stock set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,176 @@
|
||||
<?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.HealthMedicineStockInMapper">
|
||||
|
||||
<resultMap type="HealthMedicineStockInVo" id="HealthMedicineStockInResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="medicineId" column="medicine_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="expiringDate" column="expiring_date" />
|
||||
<result property="purchaseDate" column="purchase_date" />
|
||||
<result property="purchasePrice" column="purchase_price" />
|
||||
<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="state" column="state" />
|
||||
<result property="leftCount" column="left_count" />
|
||||
<result property="usedCount" column="used_count" />
|
||||
<result property="purchaseAddress" column="purchase_address" />
|
||||
<result property="totalPrice" column="total_price" />
|
||||
<result property="medicineName" column="medicine_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHealthMedicineStockInVo">
|
||||
select
|
||||
a.id,
|
||||
a.medicine_id,
|
||||
a.quantity,
|
||||
a.production_date,
|
||||
a.expiring_date,
|
||||
a.purchase_date,
|
||||
a.purchase_price,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.code,
|
||||
a.state,
|
||||
a.left_count,
|
||||
a.used_count,
|
||||
a.purchase_address,
|
||||
a.total_price,
|
||||
hmb."name" as medicine_name
|
||||
from
|
||||
health_medicine_stock_in a
|
||||
left join health_medicine_basic hmb on
|
||||
hmb.id = a.medicine_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectHealthMedicineStockInList" parameterType="HealthMedicineStockInDto" resultMap="HealthMedicineStockInResult">
|
||||
<include refid="selectHealthMedicineStockInVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="medicineId != null "> and a.medicine_id = #{medicineId}</if>
|
||||
<if test="quantity != null "> and a.quantity = #{quantity}</if>
|
||||
<if test="productionDate != null "> and a.production_date = #{productionDate}</if>
|
||||
<if test="expiringDate != null "> and a.expiring_date = #{expiringDate}</if>
|
||||
<if test="purchaseDate != null "> and a.purchase_date = #{purchaseDate}</if>
|
||||
<if test="purchasePrice != null "> and a.purchase_price = #{purchasePrice}</if>
|
||||
<if test="code != null and code != ''"> and a.code = #{code}</if>
|
||||
<if test="state != null and state != ''"> and a.state = #{state}</if>
|
||||
<if test="leftCount != null "> and a.left_count = #{leftCount}</if>
|
||||
<if test="usedCount != null "> and a.used_count = #{usedCount}</if>
|
||||
<if test="purchaseAddress != null and purchaseAddress != ''"> and a.purchase_address = #{purchaseAddress}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.purchase_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectHealthMedicineStockInById" parameterType="Long" resultMap="HealthMedicineStockInResult">
|
||||
<include refid="selectHealthMedicineStockInVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHealthMedicineStockIn" parameterType="HealthMedicineStockIn">
|
||||
insert into health_medicine_stock_in
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="medicineId != null">medicine_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="expiringDate != null">expiring_date,</if>
|
||||
<if test="purchaseDate != null">purchase_date,</if>
|
||||
<if test="purchasePrice != null">purchase_price,</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="state != null and state != ''">state,</if>
|
||||
<if test="leftCount != null">left_count,</if>
|
||||
<if test="usedCount != null">used_count,</if>
|
||||
<if test="purchaseAddress != null">purchase_address,</if>
|
||||
<if test="totalPrice != null">total_price,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="medicineId != null">#{medicineId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="expiringDate != null">#{expiringDate},</if>
|
||||
<if test="purchaseDate != null">#{purchaseDate},</if>
|
||||
<if test="purchasePrice != null">#{purchasePrice},</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="state != null and state != ''">#{state},</if>
|
||||
<if test="leftCount != null">#{leftCount},</if>
|
||||
<if test="usedCount != null">#{usedCount},</if>
|
||||
<if test="purchaseAddress != null">#{purchaseAddress},</if>
|
||||
<if test="totalPrice != null">#{totalPrice},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHealthMedicineStockIn" parameterType="HealthMedicineStockIn">
|
||||
update health_medicine_stock_in
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="medicineId != null">medicine_id = #{medicineId},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="expiringDate != null">expiring_date = #{expiringDate},</if>
|
||||
<if test="purchaseDate != null">purchase_date = #{purchaseDate},</if>
|
||||
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</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="state != null and state != ''">state = #{state},</if>
|
||||
<if test="leftCount != null">left_count = #{leftCount},</if>
|
||||
<if test="usedCount != null">used_count = #{usedCount},</if>
|
||||
<if test="purchaseAddress != null">purchase_address = #{purchaseAddress},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHealthMedicineStockInById" parameterType="Long">
|
||||
delete from health_medicine_stock_in where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHealthMedicineStockInByIds" parameterType="String">
|
||||
delete from health_medicine_stock_in where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeHealthMedicineStockInById" parameterType="Long">
|
||||
update health_medicine_stock_in set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeHealthMedicineStockInByIds" parameterType="String">
|
||||
update health_medicine_stock_in set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user