76 lines
3.3 KiB
XML
Raw Normal View History

<?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.zhyc.module.feed.mapper.SgFeedListMapper">
<resultMap type="SgFeedList" id="SgFeedListResult">
<result property="id" column="id" />
<result property="formulaId" column="formula_id" />
<result property="formulaBatchId" column="formula_batch_id" />
<result property="zookeeper" column="zookeeper" />
<result property="deployDate" column="deploy_date" />
</resultMap>
<sql id="selectSgFeedListVo">
select id, formula_id, formula_batch_id, zookeeper, deploy_date from sg_feed_list
</sql>
<select id="selectSgFeedListList" parameterType="SgFeedList" resultMap="SgFeedListResult">
<include refid="selectSgFeedListVo"/>
<where>
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
<if test="formulaBatchId != null and formulaBatchId != ''"> and formula_batch_id = #{formulaBatchId}</if>
<if test="zookeeper != null and zookeeper != ''"> and zookeeper = #{zookeeper}</if>
<if test="deployDate != null "> and deploy_date = #{deployDate}</if>
</where>
ORDER BY deploy_date ASC, formula_id ASC, formula_batch_id ASC
</select>
<select id="selectSgFeedListById" parameterType="Long" resultMap="SgFeedListResult">
<include refid="selectSgFeedListVo"/>
where id = #{id}
</select>
<insert id="insertSgFeedList" parameterType="SgFeedList" useGeneratedKeys="true" keyProperty="id">
insert into sg_feed_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formulaId != null">formula_id,</if>
<if test="formulaBatchId != null">formula_batch_id,</if>
<if test="zookeeper != null">zookeeper,</if>
<if test="deployDate != null">deploy_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formulaId != null">#{formulaId},</if>
<if test="formulaBatchId != null">#{formulaBatchId},</if>
<if test="zookeeper != null">#{zookeeper},</if>
<if test="deployDate != null">#{deployDate},</if>
</trim>
</insert>
<update id="updateSgFeedList" parameterType="SgFeedList">
update sg_feed_list
<trim prefix="SET" suffixOverrides=",">
<if test="formulaId != null">formula_id = #{formulaId},</if>
<if test="formulaBatchId != null">formula_batch_id = #{formulaBatchId},</if>
<if test="zookeeper != null">zookeeper = #{zookeeper},</if>
<if test="deployDate != null">deploy_date = #{deployDate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSgFeedListById" parameterType="Long">
delete from sg_feed_list where id = #{id}
</delete>
<delete id="deleteSgFeedListByIds" parameterType="String">
delete from sg_feed_list where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteAll">
DELETE FROM sg_feed_list;
</delete>
</mapper>