Compare commits
2 Commits
6d6ea86942
...
d853dbe5a3
Author | SHA1 | Date | |
---|---|---|---|
d853dbe5a3 | |||
61113ed805 |
@ -26,37 +26,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectNpFreshMilkInspVo">
|
<sql id="selectNpFreshMilkInspVo">
|
||||||
select id, source, datetime, fat, protein, non_fat, acidity, bacterial_colony_1, bacterial_colony_2, bacterial_colony_3, bacterial_colony_4, bacterial_colony_5, coli, lactoferrin, ig, commnet, create_by, create_time from np_fresh_milk_insp
|
SELECT
|
||||||
|
id, source, datetime, fat, protein, non_fat, acidity,
|
||||||
|
bacterial_colony_1, bacterial_colony_2, bacterial_colony_3,
|
||||||
|
bacterial_colony_4, bacterial_colony_5, coli, lactoferrin,
|
||||||
|
ig, commnet, create_by, create_time
|
||||||
|
FROM np_fresh_milk_insp
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!-- 查询列表(已修改为只按来源和日期查询) -->
|
||||||
<select id="selectNpFreshMilkInspList" parameterType="NpFreshMilkInsp" resultMap="NpFreshMilkInspResult">
|
<select id="selectNpFreshMilkInspList" parameterType="NpFreshMilkInsp" resultMap="NpFreshMilkInspResult">
|
||||||
<include refid="selectNpFreshMilkInspVo"/>
|
<include refid="selectNpFreshMilkInspVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
<if test="source != null and source != ''">
|
||||||
<if test="datetime != null "> and datetime = #{datetime}</if>
|
AND source LIKE CONCAT('%', #{source}, '%')
|
||||||
<if test="fat != null "> and fat = #{fat}</if>
|
</if>
|
||||||
<if test="protein != null "> and protein = #{protein}</if>
|
<if test="datetime != null">
|
||||||
<if test="nonFat != null "> and non_fat = #{nonFat}</if>
|
AND datetime = #{datetime}
|
||||||
<if test="acidity != null "> and acidity = #{acidity}</if>
|
</if>
|
||||||
<if test="bacterialColony1 != null "> and bacterial_colony_1 = #{bacterialColony1}</if>
|
|
||||||
<if test="bacterialColony2 != null "> and bacterial_colony_2 = #{bacterialColony2}</if>
|
|
||||||
<if test="bacterialColony3 != null "> and bacterial_colony_3 = #{bacterialColony3}</if>
|
|
||||||
<if test="bacterialColony4 != null "> and bacterial_colony_4 = #{bacterialColony4}</if>
|
|
||||||
<if test="bacterialColony5 != null "> and bacterial_colony_5 = #{bacterialColony5}</if>
|
|
||||||
<if test="coli != null "> and coli = #{coli}</if>
|
|
||||||
<if test="lactoferrin != null "> and lactoferrin = #{lactoferrin}</if>
|
|
||||||
<if test="ig != null "> and ig = #{ig}</if>
|
|
||||||
<if test="commnet != null and commnet != ''"> and commnet = #{commnet}</if>
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据ID查询 -->
|
||||||
<select id="selectNpFreshMilkInspById" parameterType="Long" resultMap="NpFreshMilkInspResult">
|
<select id="selectNpFreshMilkInspById" parameterType="Long" resultMap="NpFreshMilkInspResult">
|
||||||
<include refid="selectNpFreshMilkInspVo"/>
|
<include refid="selectNpFreshMilkInspVo"/>
|
||||||
where id = #{id}
|
WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 新增 -->
|
||||||
<insert id="insertNpFreshMilkInsp" parameterType="NpFreshMilkInsp" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertNpFreshMilkInsp" parameterType="NpFreshMilkInsp" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into np_fresh_milk_insp
|
INSERT INTO np_fresh_milk_insp
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="source != null">source,</if>
|
<if test="source != null">source,</if>
|
||||||
<if test="datetime != null">datetime,</if>
|
<if test="datetime != null">datetime,</if>
|
||||||
@ -97,8 +96,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
<update id="updateNpFreshMilkInsp" parameterType="NpFreshMilkInsp">
|
<update id="updateNpFreshMilkInsp" parameterType="NpFreshMilkInsp">
|
||||||
update np_fresh_milk_insp
|
UPDATE np_fresh_milk_insp
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="source != null">source = #{source},</if>
|
<if test="source != null">source = #{source},</if>
|
||||||
<if test="datetime != null">datetime = #{datetime},</if>
|
<if test="datetime != null">datetime = #{datetime},</if>
|
||||||
@ -115,18 +115,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="lactoferrin != null">lactoferrin = #{lactoferrin},</if>
|
<if test="lactoferrin != null">lactoferrin = #{lactoferrin},</if>
|
||||||
<if test="ig != null">ig = #{ig},</if>
|
<if test="ig != null">ig = #{ig},</if>
|
||||||
<if test="commnet != null">commnet = #{commnet},</if>
|
<if test="commnet != null">commnet = #{commnet},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 单个删除 -->
|
||||||
<delete id="deleteNpFreshMilkInspById" parameterType="Long">
|
<delete id="deleteNpFreshMilkInspById" parameterType="Long">
|
||||||
delete from np_fresh_milk_insp where id = #{id}
|
DELETE FROM np_fresh_milk_insp WHERE id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
<delete id="deleteNpFreshMilkInspByIds" parameterType="String">
|
<delete id="deleteNpFreshMilkInspByIds" parameterType="String">
|
||||||
delete from np_fresh_milk_insp where id in
|
DELETE FROM np_fresh_milk_insp WHERE id IN
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -26,7 +26,11 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectNpYogurtInspVo">
|
<sql id="selectNpYogurtInspVo">
|
||||||
select id, source, datetime, fat, protein, non_fat, acidity, bacterial_colony_1, bacterial_clony_2, bacterial_clony_3, bacterial_clony_4, bacterial_clony_5, yeast, mould, lacto, comment, create_by, create_time from np_yogurt_insp
|
select id, source, datetime, fat, protein, non_fat,
|
||||||
|
acidity, bacterial_colony_1, bacterial_clony_2,
|
||||||
|
bacterial_clony_3, bacterial_clony_4, bacterial_clony_5,
|
||||||
|
yeast, mould, lacto, comment, create_by, create_time
|
||||||
|
from np_yogurt_insp
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectNpYogurtInspList" parameterType="NpYogurtInsp" resultMap="NpYogurtInspResult">
|
<select id="selectNpYogurtInspList" parameterType="NpYogurtInsp" resultMap="NpYogurtInspResult">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user