Commit 4e69edea authored by libin's avatar libin

行为日志记录

parent a89fb725
......@@ -4,10 +4,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.user.behavior.dto.BehaviorTypeDTO;
import com.xxfc.platform.user.behavior.entity.BehaviorType;
import com.xxfc.platform.user.behavior.mapper.BehaviorTypeMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -20,14 +18,7 @@ import java.util.List;
public class BehaviorTypeBiz extends BaseBiz<BehaviorTypeMapper, BehaviorType> {
public List<BehaviorTypeDTO> findBehaviorTypesByIds(List<Integer> typeIds){
List<BehaviorTypeDTO> behaviorTypeDTOS = new ArrayList<>();
List<BehaviorType> behaviorTypes = mapper.selectByIdList(typeIds);
BehaviorTypeDTO behaviorTypeDTO;
for (BehaviorType behaviorType : behaviorTypes) {
behaviorTypeDTO = new BehaviorTypeDTO();
BeanUtils.copyProperties(behaviorType,behaviorTypeDTO);
behaviorTypeDTOS.add(behaviorTypeDTO);
}
return behaviorTypeDTOS;
return mapper.selectAllByIdList(typeIds);
}
}
......@@ -17,7 +17,7 @@ import java.util.List;
* @data 2019/8/13 14:10
*/
public interface ActivityBehaviorMapper extends Mapper<ActivityBehavior> {
@Select("select `behavior_type_id` from `activity_behavior` where `activity_id`=#{activityId}")
@Select("select `activity_id`,`behavior_type_id` from `activity_behavior` where `activity_id`=#{activityId}")
@Results(value = {
@Result(column = "activity_id",property = "activityId"),
@Result(column = "behavior_type_id",property = "behaviorTypeId")
......
......@@ -18,7 +18,7 @@ import java.util.List;
*/
public interface ActivityBehaviorRelationMapper extends Mapper<ActivityBehaviorRelation> {
@Select("select * from `activity_behavior_relation` where `activity_id`=#{activityId}")
@Select("select `type`,`biz_id`,`activity_id` from `activity_behavior_relation` where `activity_id`=#{activityId}")
@Results(value = {
@Result(property = "type",column = "type"),
@Result(property = "bizId",column = "biz_id"),
......
package com.xxfc.platform.user.behavior.mapper;
import com.xxfc.platform.user.behavior.dto.BehaviorTypeDTO;
import com.xxfc.platform.user.behavior.entity.BehaviorType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.IdListMapper;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* @author libin
* @version 1.0
......@@ -11,4 +18,11 @@ import tk.mybatis.mapper.common.Mapper;
* @data 2019/8/13 14:13
*/
public interface BehaviorTypeMapper extends Mapper<BehaviorType>, IdListMapper<BehaviorType,Integer> {
@Select("<script>select `name`,`code` from behavior_type where `id` in <foreach collection='typeIds' open='(' item='typeId' separator=',' close=')'> #{typeId}</foreach></script>")
@Results(value = {
@Result(column = "name",property = "name"),
@Result(column ="code",property = "code")
})
List<BehaviorTypeDTO> selectAllByIdList(@Param("typeIds") List<Integer> typeIds);
}
......@@ -45,6 +45,6 @@
<if test="endTime != null and startTime == null">
and <![CDATA[ `crt_time` <= #{endTime}]]>
</if>
and `type` in(0,1,2,3)
</select>
</mapper>
\ No newline at end of file
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