Commit b1fe8056 authored by 刘基明's avatar 刘基明

Merge remote-tracking branch 'origin/dev' into dev

parents e76f61b4 41cba0d0
...@@ -21,8 +21,8 @@ import java.util.List; ...@@ -21,8 +21,8 @@ import java.util.List;
* @since 2021-07-28 * @since 2021-07-28
*/ */
public interface VisitLogMapper extends BaseMapper<VisitLogEntity> { public interface VisitLogMapper extends BaseMapper<VisitLogEntity> {
@Select("select * from visit_log where ident=#{ident} and ref_id=#{refId}") @Select("select * from visit_log where ident=#{ident} and ref_id=#{refId} and ref_type=#{refType}")
VisitLogEntity selectByIdentAndRefId(@Param("ident") String ident, @Param("refId") String refId); VisitLogEntity selectByIdentAndRefId(@Param("ident") String ident, @Param("refId") String refId, @Param("refType") String refType);
@Update("update visit_log set duration=duration+#{duration} where ident=#{ident}") @Update("update visit_log set duration=duration+#{duration} where ident=#{ident}")
void updateDurByIdent(@Param("duration") Integer dur, @Param("ident") String ident); void updateDurByIdent(@Param("duration") Integer dur, @Param("ident") String ident);
......
...@@ -58,7 +58,7 @@ public class VisitLogService { ...@@ -58,7 +58,7 @@ public class VisitLogService {
@Transactional @Transactional
public void insertOrUpdateDur(VisitLogEntity vs) { public void insertOrUpdateDur(VisitLogEntity vs) {
if (visitLogMapper.selectByIdentAndRefId(vs.getIdent(), vs.getRefId()) == null) { if (visitLogMapper.selectByIdentAndRefId(vs.getIdent(), vs.getRefType(), vs.getRefId()) == null) {
visitLogMapper.insert(vs); visitLogMapper.insert(vs);
} else { } else {
visitLogMapper.updateDurByIdent(vs.getDuration(), vs.getIdent()); visitLogMapper.updateDurByIdent(vs.getDuration(), vs.getIdent());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment