|
|
@@ -1,15 +1,17 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.BusPatientMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="BusPatient" id="BusPatientResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="code" column="code" />
|
|
|
<result property="name" column="name" />
|
|
|
<result property="gender" column="gender" />
|
|
|
<result property="height" column="height" />
|
|
|
+ <result property="age" column="age" />
|
|
|
+ <result property="weight" column="weight" />
|
|
|
<result property="source" column="source" />
|
|
|
<result property="address" column="address" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
@@ -18,21 +20,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="relationPhone" column="relation_phone" />
|
|
|
<result property="dieTime" column="die_time" />
|
|
|
<result property="isDelete" column="is_delete" />
|
|
|
- <result property="age" column="age" />
|
|
|
- <result property="weight" column="weight" />
|
|
|
+ <result property="status" column="status" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectBusPatientVo">
|
|
|
- select id, code, name, gender, height, source, address, create_time, phone, relation_name, relation_phone, die_time, is_delete, age, weight from bus_patient
|
|
|
+ select id, code, name, gender, height, age, weight, source, address, create_time, phone, relation_name, relation_phone, die_time, is_delete, status from bus_patient
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectBusPatientList" parameterType="BusPatient" resultMap="BusPatientResult">
|
|
|
<include refid="selectBusPatientVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
<if test="gender != null "> and gender = #{gender}</if>
|
|
|
<if test="height != null "> and height = #{height}</if>
|
|
|
+ <if test="age != null "> and age = #{age}</if>
|
|
|
+ <if test="weight != null "> and weight = #{weight}</if>
|
|
|
<if test="source != null "> and source = #{source}</if>
|
|
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
@@ -40,16 +43,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="relationPhone != null and relationPhone != ''"> and relation_phone = #{relationPhone}</if>
|
|
|
<if test="dieTime != null "> and die_time = #{dieTime}</if>
|
|
|
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
- <if test="age != null "> and age = #{age}</if>
|
|
|
- <if test="weight != null "> and weight = #{weight}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectBusPatientById" parameterType="Long" resultMap="BusPatientResult">
|
|
|
<include refid="selectBusPatientVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertBusPatient" parameterType="BusPatient" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into bus_patient
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -57,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="name != null">name,</if>
|
|
|
<if test="gender != null">gender,</if>
|
|
|
<if test="height != null">height,</if>
|
|
|
+ <if test="age != null">age,</if>
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
<if test="source != null">source,</if>
|
|
|
<if test="address != null">address,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
@@ -65,14 +69,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="relationPhone != null">relation_phone,</if>
|
|
|
<if test="dieTime != null">die_time,</if>
|
|
|
<if test="isDelete != null">is_delete,</if>
|
|
|
- <if test="age != null">age,</if>
|
|
|
- <if test="weight != null">weight,</if>
|
|
|
- </trim>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="code != null">#{code},</if>
|
|
|
<if test="name != null">#{name},</if>
|
|
|
<if test="gender != null">#{gender},</if>
|
|
|
<if test="height != null">#{height},</if>
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
<if test="source != null">#{source},</if>
|
|
|
<if test="address != null">#{address},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
@@ -81,9 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="relationPhone != null">#{relationPhone},</if>
|
|
|
<if test="dieTime != null">#{dieTime},</if>
|
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
|
- <if test="age != null">#{age},</if>
|
|
|
- <if test="weight != null">#{weight},</if>
|
|
|
- </trim>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateBusPatient" parameterType="BusPatient">
|
|
|
@@ -93,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="name != null">name = #{name},</if>
|
|
|
<if test="gender != null">gender = #{gender},</if>
|
|
|
<if test="height != null">height = #{height},</if>
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
<if test="source != null">source = #{source},</if>
|
|
|
<if test="address != null">address = #{address},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
@@ -101,8 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="relationPhone != null">relation_phone = #{relationPhone},</if>
|
|
|
<if test="dieTime != null">die_time = #{dieTime},</if>
|
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
- <if test="age != null">age = #{age},</if>
|
|
|
- <if test="weight != null">weight = #{weight},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -112,9 +117,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteBusPatientByIds" parameterType="String">
|
|
|
- delete from bus_patient where id in
|
|
|
+ delete from bus_patient where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <update id="updateStatusByIds">
|
|
|
+ update bus_device_history
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ </trim>
|
|
|
+ where id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
</mapper>
|