|
|
|
|
@ -19,10 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="nursingDays" column="nursing_days" />
|
|
|
|
|
<result property="nursingDaysWeek" column="nursing_days_week" />
|
|
|
|
|
<result property="nursingDaysMonth" column="nursing_days_month" />
|
|
|
|
|
<result property="nursingDaysYear" column="nursing_days_year" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectWxNursingLogVo">
|
|
|
|
|
select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time from wx_nursing_log
|
|
|
|
|
select id, user_id, instrument_id, instrument_name, online, mode_id, mode_name, nursing_time, completion_percentage, status, create_by, create_time, update_by, update_time, nursing_days, nursing_days_week, nursing_days_month, nursing_days_year from wx_nursing_log
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectWxNursingLogList" parameterType="WxNursingLog" resultMap="WxNursingLogResult">
|
|
|
|
|
@ -97,6 +101,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectLastNursingLogByUserId" resultMap="WxNursingLogResult">
|
|
|
|
|
<include refid="selectWxNursingLogVo"/>
|
|
|
|
|
WHERE
|
|
|
|
|
user_id = #{userId}
|
|
|
|
|
AND instrument_id = #{instrumentId}
|
|
|
|
|
ORDER BY
|
|
|
|
|
update_time DESC
|
|
|
|
|
LIMIT 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertWxNursingLog" parameterType="WxNursingLog" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into wx_nursing_log
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
@ -113,6 +127,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="nursingDays != null">nursing_days,</if>
|
|
|
|
|
<if test="nursingDaysWeek != null">nursing_days_week,</if>
|
|
|
|
|
<if test="nursingDaysMonth != null">nursing_days_month,</if>
|
|
|
|
|
<if test="nursingDaysYear != null">nursing_days_year,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
|
@ -128,6 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="nursingDays != null">#{nursingDays},</if>
|
|
|
|
|
<if test="nursingDaysWeek != null">#{nursingDaysWeek},</if>
|
|
|
|
|
<if test="nursingDaysMonth != null">#{nursingDaysMonth},</if>
|
|
|
|
|
<if test="nursingDaysYear != null">#{nursingDaysYear},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
@ -147,6 +169,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<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="nursingDays != null">nursing_days = #{nursingDays},</if>
|
|
|
|
|
<if test="nursingDaysWeek != null">nursing_days_week = #{nursingDaysWeek},</if>
|
|
|
|
|
<if test="nursingDaysMonth != null">nursing_days_month = #{nursingDaysMonth},</if>
|
|
|
|
|
<if test="nursingDaysYear != null">nursing_days_year = #{nursingDaysYear},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|