Compare commits

..

No commits in common. "d853dbe5a3cc90c9fdec0e472a2de9aeb727e693" and "6d6ea869429c112fd899369563260f07630abb90" have entirely different histories.

2 changed files with 52 additions and 56 deletions

View File

@ -1,61 +1,62 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.dairyProducts.mapper.NpFreshMilkInspMapper">
<resultMap type="NpFreshMilkInsp" id="NpFreshMilkInspResult">
<result property="id" column="id" />
<result property="source" column="source" />
<result property="datetime" column="datetime" />
<result property="fat" column="fat" />
<result property="protein" column="protein" />
<result property="nonFat" column="non_fat" />
<result property="acidity" column="acidity" />
<result property="bacterialColony1" column="bacterial_colony_1" />
<result property="bacterialColony2" column="bacterial_colony_2" />
<result property="bacterialColony3" column="bacterial_colony_3" />
<result property="bacterialColony4" column="bacterial_colony_4" />
<result property="bacterialColony5" column="bacterial_colony_5" />
<result property="coli" column="coli" />
<result property="lactoferrin" column="lactoferrin" />
<result property="ig" column="ig" />
<result property="commnet" column="commnet" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="id" column="id" />
<result property="source" column="source" />
<result property="datetime" column="datetime" />
<result property="fat" column="fat" />
<result property="protein" column="protein" />
<result property="nonFat" column="non_fat" />
<result property="acidity" column="acidity" />
<result property="bacterialColony1" column="bacterial_colony_1" />
<result property="bacterialColony2" column="bacterial_colony_2" />
<result property="bacterialColony3" column="bacterial_colony_3" />
<result property="bacterialColony4" column="bacterial_colony_4" />
<result property="bacterialColony5" column="bacterial_colony_5" />
<result property="coli" column="coli" />
<result property="lactoferrin" column="lactoferrin" />
<result property="ig" column="ig" />
<result property="commnet" column="commnet" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<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>
<!-- 查询列表(已修改为只按来源和日期查询) -->
<select id="selectNpFreshMilkInspList" parameterType="NpFreshMilkInsp" resultMap="NpFreshMilkInspResult">
<include refid="selectNpFreshMilkInspVo"/>
<where>
<if test="source != null and source != ''">
AND source LIKE CONCAT('%', #{source}, '%')
</if>
<if test="datetime != null">
AND datetime = #{datetime}
</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="datetime != null "> and datetime = #{datetime}</if>
<if test="fat != null "> and fat = #{fat}</if>
<if test="protein != null "> and protein = #{protein}</if>
<if test="nonFat != null "> and non_fat = #{nonFat}</if>
<if test="acidity != null "> and acidity = #{acidity}</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>
</select>
<!-- 根据ID查询 -->
<select id="selectNpFreshMilkInspById" parameterType="Long" resultMap="NpFreshMilkInspResult">
<include refid="selectNpFreshMilkInspVo"/>
WHERE id = #{id}
where id = #{id}
</select>
<!-- 新增 -->
<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=",">
<if test="source != null">source,</if>
<if test="datetime != null">datetime,</if>
@ -74,7 +75,7 @@
<if test="commnet != null">commnet,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="source != null">#{source},</if>
<if test="datetime != null">#{datetime},</if>
@ -93,12 +94,11 @@
<if test="commnet != null">#{commnet},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</trim>
</insert>
<!-- 修改 -->
<update id="updateNpFreshMilkInsp" parameterType="NpFreshMilkInsp">
UPDATE np_fresh_milk_insp
update np_fresh_milk_insp
<trim prefix="SET" suffixOverrides=",">
<if test="source != null">source = #{source},</if>
<if test="datetime != null">datetime = #{datetime},</if>
@ -115,18 +115,18 @@
<if test="lactoferrin != null">lactoferrin = #{lactoferrin},</if>
<if test="ig != null">ig = #{ig},</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>
WHERE id = #{id}
where id = #{id}
</update>
<!-- 单个删除 -->
<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 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=")">
#{id}
</foreach>

View File

@ -26,11 +26,7 @@
</resultMap>
<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>
<select id="selectNpYogurtInspList" parameterType="NpYogurtInsp" resultMap="NpYogurtInspResult">