|
@@ -10,25 +10,40 @@
|
|
|
left join t_user_increment ui on cil.increment_id = ui.id
|
|
|
left join t_user u on cil.operation_user = u.id
|
|
|
left join t_increment_type uit on ui.increment_type_id = uit.id
|
|
|
- where cil.rec_status = 'A' and d.agent_id = #{param.agentId}
|
|
|
- <if test="param.snCode != null and param.snCode !=''">
|
|
|
- and c.sn_code like concat ('%',#{param.snCode},'%')
|
|
|
- </if>
|
|
|
- <if test="param.operationType != null">
|
|
|
- and cil.operation_type = #{param.operationType}
|
|
|
- </if>
|
|
|
- <if test="param.incrementTypeId != null">
|
|
|
- and ui.increment_type_id = #{param.incrementTypeId}
|
|
|
- </if>
|
|
|
- <if test="param.operationUserName != null and param.operationUserName !=''">
|
|
|
- and u.user_name like concat ('%',#{param.operationUserName},'%')
|
|
|
- </if>
|
|
|
- <if test="param.operationUserName != null and param.operationUserName !=''">
|
|
|
- and u.user_name like concat ('%',#{param.operationUserName},'%')
|
|
|
- </if>
|
|
|
- <if test="param.startTime!= null and param.startTime != ''">
|
|
|
- and cil.create_time BETWEEN #{param.startTime} and #{param.endTime}
|
|
|
- </if>
|
|
|
+ where cil.rec_status = 'A'
|
|
|
+ <include refid="commonSql"></include>
|
|
|
+
|
|
|
order by cil.create_time desc
|
|
|
</select>
|
|
|
+
|
|
|
+ <sql id="commonSql">
|
|
|
+ <if test="param.agentId != null and ( param.authCameraIds == null and param.authCameraIds.size < 0 )">
|
|
|
+ and d.agent_id = #{param.agentId}
|
|
|
+ </if>
|
|
|
+ <if test="param.authCameraIds != null and param.authCameraIds.size >0">
|
|
|
+ and (d.agent_id = #{param.agentId} or d.camera_id in
|
|
|
+ <foreach collection="param.authCameraIds" item="cameraIds" open="(" separator="," close=")">
|
|
|
+ #{cameraIds}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.snCode != null and param.snCode !=''">
|
|
|
+ and c.sn_code like concat ('%',#{param.snCode},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.operationType != null">
|
|
|
+ and cil.operation_type = #{param.operationType}
|
|
|
+ </if>
|
|
|
+ <if test="param.incrementTypeId != null">
|
|
|
+ and ui.increment_type_id = #{param.incrementTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="param.operationUserName != null and param.operationUserName !=''">
|
|
|
+ and u.user_name like concat ('%',#{param.operationUserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.operationUserName != null and param.operationUserName !=''">
|
|
|
+ and u.user_name like concat ('%',#{param.operationUserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime!= null and param.startTime != ''">
|
|
|
+ and cil.create_time BETWEEN #{param.startTime} and #{param.endTime}
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
</mapper>
|