+ 修复了配料清单的分组逻辑错误:
+ 配料清单先将在原基础上再根据饲喂计划中的日期分组
+ 缓存与同步逻辑重写, 以适配新的分组逻辑
+ 修复了饲喂量统计的部分逻辑错误:
+ 解决了羊舍信息的SQL与Service层统计错误
+ 修改了缓存查询逻辑以适配新的清单缓存
76 lines
3.3 KiB
XML
76 lines
3.3 KiB
XML
<?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> |