|
@@ -8,38 +8,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="id" column="id" />
|
|
|
<result property="objCode" column="obj_code" />
|
|
|
<result property="objType" column="obj_type" />
|
|
|
+ <result property="objName" column="obj_name" />
|
|
|
<result property="modelCode" column="model_code" />
|
|
|
+ <result property="modelName" column="model_name" />
|
|
|
<result property="abilityKey" column="ability_key" />
|
|
|
+ <result property="abilityName" column="ability_name" />
|
|
|
<result property="callTime" column="call_time" />
|
|
|
- <result property="callParam" column="call_param" />
|
|
|
+ <result property="callPayload" column="call_payload" />
|
|
|
<result property="callStatus" column="call_status" />
|
|
|
<result property="resTime" column="res_time" />
|
|
|
- <result property="resParam" column="res_param" />
|
|
|
+ <result property="resPayload" column="res_payload" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectList">
|
|
|
- select id, obj_code, obj_type, model_code, ability_key, call_time, call_status, res_time from adm_ems_obj_ability_call_log
|
|
|
+ select l.id, l.obj_code,
|
|
|
+ CASE
|
|
|
+ WHEN l.obj_type = 1 THEN f.facs_name
|
|
|
+ WHEN l.obj_type = 2 THEN d.device_name
|
|
|
+ END as obj_name,
|
|
|
+ l.obj_type, l.model_code, m.model_name, l.ability_key, a.ability_name, l.call_time, l.call_status from adm_ems_obj_ability_call_log l
|
|
|
+ left join adm_ems_facs f on l.obj_code = f.facs_code and l.obj_type = 1
|
|
|
+ left join adm_ems_device d on l.obj_code = d.device_code and l.obj_type = 2
|
|
|
+ left join adm_ems_obj_model m on l.model_code = m.model_code and l.obj_type = m.obj_type
|
|
|
+ left join adm_ems_obj_ability a on l.ability_key = a.ability_key
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectDetail">
|
|
|
- select id, obj_code, obj_type, model_code, ability_key, call_time, call_param, call_status, res_time, res_param from adm_ems_obj_ability_call_log
|
|
|
+ select l.id, l.obj_code,
|
|
|
+ case
|
|
|
+ when l.obj_type = 1 then f.facs_name
|
|
|
+ when l.obj_type = 2 then d.device_name
|
|
|
+ end as obj_name,
|
|
|
+ l.obj_type, l.model_code, m.model_name, l.ability_key, a.ability_name, l.call_time, l.call_status, l.call_payload, l.res_time, l.res_payload from adm_ems_obj_ability_call_log l
|
|
|
+ left join adm_ems_facs f on l.obj_code = f.facs_code and l.obj_type = 1
|
|
|
+ left join adm_ems_device d on l.obj_code = d.device_code and l.obj_type = 2
|
|
|
+ left join adm_ems_obj_model m on l.model_code = m.model_code and l.obj_type = m.obj_type
|
|
|
+ left join adm_ems_obj_ability a on l.ability_key = a.ability_key
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectObjAbilityCallLogById" parameterType="java.lang.Long" resultMap="objAbilityCallLogResult">
|
|
|
<include refid="selectDetail"/>
|
|
|
- where id = #{id}
|
|
|
+ where l.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectObjAbilityCallLog" parameterType="com.ruoyi.ems.domain.EmsObjAbilityCallLog" resultMap="objAbilityCallLogResult">
|
|
|
<include refid="selectList"/>
|
|
|
<where>
|
|
|
- <if test="objCode != null and objCode != ''"> and obj_code = #{objCode}</if>
|
|
|
- <if test="objType != null "> and obj_type = #{objType}</if>
|
|
|
- <if test="modelCode != null and modelCode != ''"> and model_code = #{modelCode}</if>
|
|
|
- <if test="abilityKey != null and abilityKey != ''"> and ability_key = #{abilityKey}</if>
|
|
|
- <if test="callStatus != null "> and call_status = #{callStatus}</if>
|
|
|
+ <if test="objCode != null and objCode != ''"> and l.obj_code = #{objCode}</if>
|
|
|
+ <if test="objType != null "> and l.obj_type = #{objType}</if>
|
|
|
+ <if test="modelCode != null and modelCode != ''"> and l.model_code = #{modelCode}</if>
|
|
|
+ <if test="abilityKey != null and abilityKey != ''"> and l.ability_key = #{abilityKey}</if>
|
|
|
+ <if test="callStatus != null "> and l.call_status = #{callStatus}</if>
|
|
|
<if test="startRecTime != null and startRecTime != '' and endRecTime != null and endRecTime !=''">
|
|
|
- and call_time between #{startRecTime} and #{endRecTime}
|
|
|
+ and l.call_time between #{startRecTime} and #{endRecTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
@@ -52,10 +73,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="modelCode != null and modelCode != ''">model_code,</if>
|
|
|
<if test="abilityKey != null and abilityKey != ''">ability_key,</if>
|
|
|
<if test="callTime != null">call_time,</if>
|
|
|
- <if test="callParam != null">call_param,</if>
|
|
|
+ <if test="callPayload != null">call_payload,</if>
|
|
|
<if test="callStatus != null">call_status,</if>
|
|
|
<if test="resTime != null">res_time,</if>
|
|
|
- <if test="resParam != null">res_param,</if>
|
|
|
+ <if test="resPayload != null">res_payload,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="objCode != null and objCode != ''">#{objCode},</if>
|
|
@@ -63,14 +84,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="modelCode != null and modelCode != ''">#{modelCode},</if>
|
|
|
<if test="abilityKey != null and abilityKey != ''">#{abilityKey},</if>
|
|
|
<if test="callTime != null">#{callTime},</if>
|
|
|
- <if test="callParam != null">#{callParam},</if>
|
|
|
+ <if test="callPayload != null">#{callPayload},</if>
|
|
|
<if test="callStatus != null">#{callStatus},</if>
|
|
|
<if test="resTime != null">#{resTime},</if>
|
|
|
- <if test="resParam != null">#{resParam},</if>
|
|
|
+ <if test="resPayload != null">#{resPayload},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateObjAbilityCallLog" parameterType="EmsObjAbilityCallLog">
|
|
|
+ <update id="updateObjAbilityCallLog" parameterType="com.ruoyi.ems.domain.EmsObjAbilityCallLog">
|
|
|
update adm_ems_obj_ability_call_log
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
|
|
@@ -78,10 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
|
|
|
<if test="abilityKey != null and abilityKey != ''">ability_key = #{abilityKey},</if>
|
|
|
<if test="callTime != null">call_time = #{callTime},</if>
|
|
|
- <if test="callParam != null">call_param = #{callParam},</if>
|
|
|
+ <if test="callPayload != null">call_payload = #{callPayload},</if>
|
|
|
<if test="callStatus != null">call_status = #{callStatus},</if>
|
|
|
<if test="resTime != null">res_time = #{resTime},</if>
|
|
|
- <if test="resParam != null">res_param = #{resParam},</if>
|
|
|
+ <if test="resPayload != null">res_payload = #{resPayload},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|