Commit bb5b34f3 by 陶光胜

init

parent 310d9b92
package com.gic.message.dao.mapper;
import com.gic.store.entity.TabCity;
import java.util.List;
public interface TabCityMapper {
/**
* 根据主键删除
*
* @param cityId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(String cityId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabCity record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabCity record);
/**
* 根据主键查询
*
* @param cityId 主键
* @return 实体对象
*/
TabCity selectByPrimaryKey(String cityId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabCity record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabCity record);
/**
* 查询所有城市
* @return
*/
List<TabCity> selectAllCity();
}
\ No newline at end of file
package com.gic.message.dao.mapper;
public class TestMapper {
}
......@@ -11,7 +11,7 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private static final Logger log = LogManager.getLogger(KafkaMessageServiceImpl.class);
@Override
public void onMessage(ConsumerRecord<String, GicRecord> stringGicRecordConsumerRecord) {
log.info("接收kafka消息,内容为:{}", JSON.toJSONString(stringGicRecordConsumerRecord));
public void onMessage(ConsumerRecord<String, GicRecord> consumerRecord) {
log.info("接收kafka消息,内容为111:"+consumerRecord.value());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.store.dao.mapper.TabCityMapper">
<resultMap id="BaseResultMap" type="com.gic.store.entity.TabCity">
<id column="city_id" jdbcType="VARCHAR" property="cityId" />
<result column="city_name" jdbcType="VARCHAR" property="cityName" />
<result column="province_id" jdbcType="VARCHAR" property="provinceId" />
<result column="city_py" jdbcType="VARCHAR" property="cityPy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
city_id, city_name, province_id, city_py, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_city
where city_id = #{cityId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_city
where city_id = #{cityId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.store.entity.TabCity">
insert into tab_city (city_id, city_name, province_id,
city_py, create_time, update_time
)
values (#{cityId,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, #{provinceId,jdbcType=VARCHAR},
#{cityPy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabCity">
insert into tab_city
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cityId != null">
city_id,
</if>
<if test="cityName != null">
city_name,
</if>
<if test="provinceId != null">
province_id,
</if>
<if test="cityPy != null">
city_py,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cityId != null">
#{cityId,jdbcType=VARCHAR},
</if>
<if test="cityName != null">
#{cityName,jdbcType=VARCHAR},
</if>
<if test="provinceId != null">
#{provinceId,jdbcType=VARCHAR},
</if>
<if test="cityPy != null">
#{cityPy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.store.entity.TabCity">
update tab_city
<set>
<if test="cityName != null">
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if test="provinceId != null">
province_id = #{provinceId,jdbcType=VARCHAR},
</if>
<if test="cityPy != null">
city_py = #{cityPy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where city_id = #{cityId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.store.entity.TabCity">
update tab_city
set city_name = #{cityName,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=VARCHAR},
city_py = #{cityPy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where city_id = #{cityId,jdbcType=VARCHAR}
</update>
<select id="selectAllCity" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_city
</select>
<select id="queryCity" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_city where 1=1
<if test="search != null and search != ''">
and city_name like concat('%',#{search}, '%')
</if>
</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