Authored by Zhang

<SRS> no message.

... ... @@ -33,6 +33,9 @@ public class ChannelReportFormServiceImpl implements IChannelReportFormService {
String dateIdStr = dateStr.replace("-", "");
reportForm.setDateId(Integer.parseInt(dateIdStr));
reportForm.setCreateTime(DateUtil.getCurrentTimeSeconds());
reportForm.setUpdateTime(DateUtil.getCurrentTimeSeconds());
channelReportFormDAO.insertSelective(reportForm);
}
}
... ...
... ... @@ -98,6 +98,16 @@ public class DateUtil {
}
/**
* 获取当前时间, 并且将当前时间转换称INT类型
*
* @return 当前时间的INT类型
*/
public static int getCurrentTimeSeconds() {
long longTime = System.currentTimeMillis();
return (int) (longTime / 1000);
}
/**
* 对日期进行加减
* @param date 被转换的日期
* @param type 转换类型(y-年,M-月,d-日, H-小时, m-分钟, s-秒)
... ...
... ... @@ -34,4 +34,9 @@ public class ChannelReportForm {
//日期
private Integer dateId;
//创建时间
private Integer createTime;
//更新时间
private Integer updateTime;
}
... ...
... ... @@ -4,7 +4,7 @@
<insert id="insert" parameterType="com.yoho.unions.dal.model.ChannelReportForm" keyProperty="id" useGeneratedKeys="true" >
insert into
channel_report_form (
channnel_report_form (
id,
app_key,
channel_code,
... ... @@ -25,12 +25,12 @@
#{exposureNum,jdbcType=INTEGER},
#{clickNum,jdbcType=INTEGER},
#{dateId,jdbcType=INTEGER},
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
#{createTime,jdbcType=INTEGER},
#{updateTime,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.ChannelReportForm" keyProperty="id" useGeneratedKeys="true">
insert into channel_report_form
insert into channnel_report_form
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
... ... @@ -56,8 +56,12 @@
<if test="dateId != null" >
date_id,
</if>
create_time,
update_time
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -84,8 +88,12 @@
<if test="dateId != null">
#{dateId,jdbcType=INTEGER},
</if>
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
... ...
... ... @@ -56,6 +56,7 @@ datasources:
- com.yoho.unions.dal.IMobilePanChannelDAO
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.IUnionUidTypeDAO
- com.yoho.unions.dal.IChannelReportFormDAO
bigdata_yh_unions:
servers:
... ...