Commit 084fb540 by fudahua

同步优化初步

parent 7c3f9d19
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface PreDealLogMapper {
/**
*/
int deleteByPrimaryKey(Integer id);
/**
*/
int insert(TabHaobanPreDealLog record);
/**
*/
int insertSelective(TabHaobanPreDealLog record);
/**
*/
TabHaobanPreDealLog selectByPrimaryKey(Integer id);
/**
*/
int updateByPrimaryKeySelective(TabHaobanPreDealLog record);
/**
*/
int updateByPrimaryKey(TabHaobanPreDealLog record);
/**
* 获取单条数据
*
* @param taskId
* @param dataId
* @return
*/
TabHaobanPreDealLog getByDataId(@Param("taskId") String taskId, @Param("dataId") String dataId, int status);
/**
* 获取单条数据
*
* @param taskId
* @param pDataId
* @return
*/
List<TabHaobanPreDealLog> listByPDataId(@Param("taskId") String taskId, @Param("dataId") String pDataId, @Param("status") int status);
/**
* 更新状态
*
* @param taskId
* @param dataId
* @param status
* @return
*/
public int updateStatusByDataId(@Param("taskId") String taskId, @Param("dataId") String dataId, @Param("status") int status);
/**
* 校验任务
*
* @param taskId
* @param dataType
* @return
*/
public int checkTask(@Param("taskId") String taskId, @Param("dataType") int dataType, @Param("status") int status);
public List<TabHaobanPreDealLog> listByTaskId(@Param("taskId") String taskId, @Param("dataType") int dataType, @Param("status") int status);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanSyncTask;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyncTaskMapper {
/**
*/
int deleteByPrimaryKey(String taskId);
/**
*/
int insert(TabHaobanSyncTask record);
/**
*/
int insertSelective(TabHaobanSyncTask record);
/**
*/
TabHaobanSyncTask selectByPrimaryKey(String taskId);
/**
*/
int updateByPrimaryKeySelective(TabHaobanSyncTask record);
/**
*/
int updateByPrimaryKey(TabHaobanSyncTask record);
}
\ No newline at end of file
<?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.haoban.manage.service.dao.mapper.PreDealLogMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanPreDealLog">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="wx_enterprise_id" jdbcType="VARCHAR" property="wxEnterpriseId"/>
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId"/>
<result column="data_id" jdbcType="VARCHAR" property="dataId"/>
<result column="p_data_id" jdbcType="VARCHAR" property="pDataId"/>
<result column="task_id" jdbcType="VARCHAR" property="taskId"/>
<result column="data_type" jdbcType="INTEGER" property="dataType"/>
<result column="status_flag" jdbcType="INTEGER" property="statusFlag"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, wx_enterprise_id,enterprise_id, data_id, p_data_id, task_id, data_type, status_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_haoban_pre_deal_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanPreDealLog">
insert into tab_haoban_pre_deal_log ( wx_enterprise_id, data_id,
p_data_id, task_id, data_type,
status_flag, create_time, update_time
)
values (#{wxEnterpriseId,jdbcType=VARCHAR}, #{dataId,jdbcType=VARCHAR},
#{pDataId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{dataType,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, now(), now()
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanPreDealLog">
insert into tab_haoban_pre_deal_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="dataId != null">
data_id,
</if>
<if test="pDataId != null">
p_data_id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="dataType != null">
data_type,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="wxEnterpriseId != null">
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="dataId != null">
#{dataId,jdbcType=VARCHAR},
</if>
<if test="pDataId != null">
#{pDataId,jdbcType=VARCHAR},
</if>
<if test="taskId != null">
#{taskId,jdbcType=VARCHAR},
</if>
<if test="dataType != null">
#{dataType,jdbcType=INTEGER},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</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.haoban.manage.service.entity.TabHaobanPreDealLog">
update tab_haoban_pre_deal_log
<set>
<if test="wxEnterpriseId != null">
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="dataId != null">
data_id = #{dataId,jdbcType=VARCHAR},
</if>
<if test="pDataId != null">
p_data_id = #{pDataId,jdbcType=VARCHAR},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=VARCHAR},
</if>
<if test="dataType != null">
data_type = #{dataType,jdbcType=INTEGER},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanPreDealLog">
update tab_haoban_pre_deal_log
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
data_id = #{dataId,jdbcType=VARCHAR},
p_data_id = #{pDataId,jdbcType=VARCHAR},
task_id = #{taskId,jdbcType=VARCHAR},
data_type = #{dataType,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getByDataId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId} and data_id=#{dataId}
<if test="status!=-1">
and status_flag=#{status}
</if>
</select>
<select id="listByPDataId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId} and p_data_id=#{dataId}
<if test="status!=-1">
and status_flag=#{status}
</if>
</select>
<update id="updateStatusByDataId">
update tab_haoban_pre_deal_log
<set>
status_flag = #{status,jdbcType=INTEGER},
update_time = now()
</set>
where data_id = #{dataId,jdbcType=INTEGER} and task_id=#{taskId}
</update>
<select id="checkTask" resultType="Integer">
select
count(*)
from tab_haoban_pre_deal_log
where task_id = #{taskId} and data_type=#{dataType}
and status_flag=#{status}
</select>
<select id="listByTaskId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId} and data_type=#{dataType}
and status_flag=#{status}
</select>
</mapper>
\ No newline at end of file
<?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.haoban.manage.service.dao.mapper.SyncTaskMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanSyncTask">
<id column="task_id" jdbcType="VARCHAR" property="taskId"/>
<result column="task_name" jdbcType="VARCHAR" property="taskName"/>
<result column="add_user" jdbcType="VARCHAR" property="addUser"/>
<result column="task_desc" jdbcType="VARCHAR" property="taskDesc"/>
<result column="status_flag" jdbcType="INTEGER" property="statusFlag"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
task_id, task_name, add_user, task_desc, status_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanSyncTask">
insert into tab_haoban_sync_task (task_id, task_name, add_user,
task_desc, status_flag, create_time,
update_time)
values (#{taskId,jdbcType=VARCHAR}, #{taskName,jdbcType=VARCHAR}, #{addUser,jdbcType=VARCHAR},
#{taskDesc,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, now(),now())
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanSyncTask">
insert into tab_haoban_sync_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">
task_id,
</if>
<if test="taskName != null">
task_name,
</if>
<if test="addUser != null">
add_user,
</if>
<if test="taskDesc != null">
task_desc,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">
#{taskId,jdbcType=VARCHAR},
</if>
<if test="taskName != null">
#{taskName,jdbcType=VARCHAR},
</if>
<if test="addUser != null">
#{addUser,jdbcType=VARCHAR},
</if>
<if test="taskDesc != null">
#{taskDesc,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</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.haoban.manage.service.entity.TabHaobanSyncTask">
update tab_haoban_sync_task
<set>
<if test="taskName != null">
task_name = #{taskName,jdbcType=VARCHAR},
</if>
<if test="addUser != null">
add_user = #{addUser,jdbcType=VARCHAR},
</if>
<if test="taskDesc != null">
task_desc = #{taskDesc,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where task_id = #{taskId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanSyncTask">
update tab_haoban_sync_task
set task_name = #{taskName,jdbcType=VARCHAR},
add_user = #{addUser,jdbcType=VARCHAR},
task_desc = #{taskDesc,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where task_id = #{taskId,jdbcType=VARCHAR}
</update>
</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