|
@@ -16,16 +16,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="stayDuration" column="stay_duration" />
|
|
|
|
+ <result property="whatEnd" column="what_end" />
|
|
|
|
+ <result property="whatEndStr" column="whatEndStr" />
|
|
<result property="loginName" column="login_name" />
|
|
<result property="loginName" column="login_name" />
|
|
<result property="sapEmployeeId" column="sap_employee_id" />
|
|
<result property="sapEmployeeId" column="sap_employee_id" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSysMagnetLogVo">
|
|
<sql id="selectSysMagnetLogVo">
|
|
- select id, user_id, user_name, login_name,sap_employee_id,org_code, org_name, level, magnet_name, create_by, create_time, update_by, update_time from sys_magnet_log
|
|
+ select id, user_id, user_name, login_name,sap_employee_id,org_code, org_name, level, magnet_name, create_by, create_time, update_by, update_time,stay_duration,what_end from sys_magnet_log
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectSysMagnetLogList" parameterType="SysMagnetLog" resultMap="SysMagnetLogResult">
|
|
<select id="selectSysMagnetLogList" parameterType="SysMagnetLog" resultMap="SysMagnetLogResult">
|
|
- select a.id, a.user_id, a.user_name,a.login_name,a.sap_employee_id, b.org_code, b.org_name, b.sales_level level, a.magnet_name, a.create_time
|
|
+ select a.id, a.user_id, a.user_name,a.login_name,a.sap_employee_id, b.org_code, b.org_name, b.sales_level level, a.magnet_name, a.create_time,
|
|
|
|
+ a.update_time,a.stay_duration,
|
|
|
|
+ case a.what_end
|
|
|
|
+ when 0 then '移动端'
|
|
|
|
+ when 1 then '电脑端'
|
|
|
|
+ else ''
|
|
|
|
+ end as whatEndStr
|
|
from sys_magnet_log a left join sys_user_ext b on a.user_id=b.user_id
|
|
from sys_magnet_log a left join sys_user_ext b on a.user_id=b.user_id
|
|
<where>
|
|
<where>
|
|
<if test="userId != null "> and a.user_id = #{userId}</if>
|
|
<if test="userId != null "> and a.user_id = #{userId}</if>
|
|
@@ -66,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="createTime != null ">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null ">update_time,</if>
|
|
<if test="updateTime != null ">update_time,</if>
|
|
|
|
+ <if test="stayDuration != null">stay_duration,</if>
|
|
|
|
+ <if test="whatEnd != null ">what_end,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null ">#{userId},</if>
|
|
<if test="userId != null ">#{userId},</if>
|
|
@@ -78,8 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="magnetName != null and magnetName != ''">#{magnetName},</if>
|
|
<if test="magnetName != null and magnetName != ''">#{magnetName},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
- <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
+ <if test="stayDuration != null">#{stayDuration},</if>
|
|
- <if test="updateTime != null ">#{updateTime},</if>
|
|
+ <if test="whatEnd != null ">#{whatEnd},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -98,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="stayDuration != null">stay_duration=#{stayDuration},</if>
|
|
|
|
+ <if test="whatEnd != null ">what_end=#{whatEnd},</if>
|
|
</trim>
|
|
</trim>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -112,5 +125,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
#{id}
|
|
#{id}
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
-
|
|
+
|
|
|
|
+ <select id="selectOneByCondition" parameterType="SysMagnetLog" resultMap="SysMagnetLogResult">
|
|
|
|
+ <include refid="selectSysMagnetLogVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
+ <if test="whatEnd != null "> and what_end = #{whatEnd}</if>
|
|
|
|
+ and magnet_name in ('渠道看板','产品看板','会员看板')
|
|
|
|
+ </where>
|
|
|
|
+ order by create_time desc limit 1
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|