Authored by 胡古飞

revert

package com.yoho.search.dal;
import com.yoho.search.dal.model.ShopDecoratorBO;
import com.yoho.search.dal.model.ShopsDecorator;
import java.util.List;
public interface ShopsDecoratorMapper {
int deleteByPrimaryKey(Integer id);
int insert(ShopsDecorator record);
int insertSelective(ShopsDecorator record);
ShopsDecorator selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ShopsDecorator record);
int updateByPrimaryKey(ShopsDecorator record);
List<ShopDecoratorBO> selectForDecoratorId();
}
\ No newline at end of file
package com.yoho.search.dal;
import com.yoho.search.dal.model.ShopsDecoratorTemplate;
import java.util.List;
public interface ShopsDecoratorTemplateMapper {
int deleteByPrimaryKey(Integer id);
int insert(ShopsDecoratorTemplate record);
int insertSelective(ShopsDecoratorTemplate record);
ShopsDecoratorTemplate selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ShopsDecoratorTemplate record);
int updateByPrimaryKey(ShopsDecoratorTemplate record);
List<ShopsDecoratorTemplate> getByShopsDecoratorIds(List<Integer> ids);
}
\ 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.yoho.search.dal.ShopsDecoratorMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ShopsDecorator">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="shops_id" property="shopsId" jdbcType="INTEGER"/>
<result column="check_status" property="checkStatus" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="app_type" property="appType" jdbcType="INTEGER"/>
<result column="blk_check_status" property="blkCheckStatus" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, shops_id, check_status, create_time, update_time, status, app_type, blk_check_status
</sql>
<resultMap id="SelectForDecoratorIdResultMap" type="com.yoho.search.dal.model.ShopDecoratorBO">
<id column="shops_id" property="shopsId" jdbcType="INTEGER"/>
<result column="shops_decorator_id" property="shopsDecoratorId" jdbcType="INTEGER"/>
</resultMap>
<select id="selectForDecoratorId" resultMap="SelectForDecoratorIdResultMap">
SELECT
shops_id,
max(id) shops_decorator_id
FROM
shops_decorator
WHERE
(shops_id, update_time) IN (
SELECT
shops_id,
max(update_time)
FROM
shops_decorator
GROUP BY
shops_id
)
AND check_status = 300
GROUP BY
shops_id;
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from shops_decorator
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from shops_decorator
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ShopsDecorator">
insert into shops_decorator (id, shops_id, check_status,
create_time, update_time, status,
app_type, blk_check_status)
values (#{id,jdbcType=INTEGER}, #{shopsId,jdbcType=INTEGER}, #{checkStatus,jdbcType=INTEGER},
#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{appType,jdbcType=INTEGER}, #{blkCheckStatus,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ShopsDecorator">
insert into shops_decorator
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopsId != null">
shops_id,
</if>
<if test="checkStatus != null">
check_status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
</if>
<if test="appType != null">
app_type,
</if>
<if test="blkCheckStatus != null">
blk_check_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="shopsId != null">
#{shopsId,jdbcType=INTEGER},
</if>
<if test="checkStatus != null">
#{checkStatus,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="appType != null">
#{appType,jdbcType=INTEGER},
</if>
<if test="blkCheckStatus != null">
#{blkCheckStatus,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ShopsDecorator">
update shops_decorator
<set>
<if test="shopsId != null">
shops_id = #{shopsId,jdbcType=INTEGER},
</if>
<if test="checkStatus != null">
check_status = #{checkStatus,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="appType != null">
app_type = #{appType,jdbcType=INTEGER},
</if>
<if test="blkCheckStatus != null">
blk_check_status = #{blkCheckStatus,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ShopsDecorator">
update shops_decorator
set shops_id = #{shopsId,jdbcType=INTEGER},
check_status = #{checkStatus,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
app_type = #{appType,jdbcType=INTEGER},
blk_check_status = #{blkCheckStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</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.yoho.search.dal.ShopsDecoratorTemplateMapper" >
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ShopsDecoratorTemplate" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="shops_decorator_id" property="shopsDecoratorId" jdbcType="INTEGER" />
<result column="platform" property="platform" jdbcType="VARCHAR" />
<result column="template_type" property="templateType" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="is_enable" property="isEnable" jdbcType="CHAR" />
<result column="app_type" property="appType" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, shops_decorator_id, platform, template_type, create_time, update_time, is_enable,
app_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from shops_decorator_template
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from shops_decorator_template
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ShopsDecoratorTemplate" >
insert into shops_decorator_template (id, shops_decorator_id, platform,
template_type, create_time, update_time,
is_enable, app_type)
values (#{id,jdbcType=INTEGER}, #{shopsDecoratorId,jdbcType=INTEGER}, #{platform,jdbcType=VARCHAR},
#{templateType,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
#{isEnable,jdbcType=CHAR}, #{appType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ShopsDecoratorTemplate" >
insert into shops_decorator_template
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="shopsDecoratorId != null" >
shops_decorator_id,
</if>
<if test="platform != null" >
platform,
</if>
<if test="templateType != null" >
template_type,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="isEnable != null" >
is_enable,
</if>
<if test="appType != null" >
app_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="shopsDecoratorId != null" >
#{shopsDecoratorId,jdbcType=INTEGER},
</if>
<if test="platform != null" >
#{platform,jdbcType=VARCHAR},
</if>
<if test="templateType != null" >
#{templateType,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=INTEGER},
</if>
<if test="isEnable != null" >
#{isEnable,jdbcType=CHAR},
</if>
<if test="appType != null" >
#{appType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ShopsDecoratorTemplate" >
update shops_decorator_template
<set >
<if test="shopsDecoratorId != null" >
shops_decorator_id = #{shopsDecoratorId,jdbcType=INTEGER},
</if>
<if test="platform != null" >
platform = #{platform,jdbcType=VARCHAR},
</if>
<if test="templateType != null" >
template_type = #{templateType,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="isEnable != null" >
is_enable = #{isEnable,jdbcType=CHAR},
</if>
<if test="appType != null" >
app_type = #{appType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ShopsDecoratorTemplate" >
update shops_decorator_template
set shops_decorator_id = #{shopsDecoratorId,jdbcType=INTEGER},
platform = #{platform,jdbcType=VARCHAR},
template_type = #{templateType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
is_enable = #{isEnable,jdbcType=CHAR},
app_type = #{appType,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getByShopsDecoratorIds" resultMap="BaseResultMap">
Select
<include refid="Base_Column_List" />
from shops_decorator_template
where
shops_decorator_id
in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file