Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -128,7 +128,8 @@
|
||||
<if test="sourceDate != null ">and source_date = #{sourceDate}</if>
|
||||
<if test="sourceRanchId != null ">and source_ranch_id = #{sourceRanchId}</if>
|
||||
<if test="comment != null and comment != ''">and comment = #{comment}</if>
|
||||
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
|
||||
<if test="isDelete == null">and is_delete = 0</if>
|
||||
<if test="isDelete != null">and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -151,20 +152,24 @@
|
||||
bv.variety AS varietyName
|
||||
FROM bas_sheep s
|
||||
LEFT JOIN bas_sheep_variety bv ON s.variety_id = bv.id
|
||||
WHERE s.manage_tags = #{manageTags} LIMIT 1
|
||||
WHERE s.manage_tags = #{manageTags}
|
||||
AND s.is_delete = 0 LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepBySheepfold" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
sheepfold_id = #{id}
|
||||
and is_delete = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSheepByRanchId" resultMap="BasSheepResult">
|
||||
SELECT *
|
||||
FROM bas_sheep
|
||||
WHERE ranch_id = #{ranchId}
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
ranch_id = #{ranchId}
|
||||
and is_delete = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepListByIds" parameterType="list" resultMap="BasSheepResult">
|
||||
@@ -320,10 +325,16 @@
|
||||
</delete>
|
||||
|
||||
<select id="existsByManageTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE manage_tags = #{tag} AND is_delete = 0
|
||||
SELECT COUNT(*)
|
||||
FROM bas_sheep
|
||||
WHERE manage_tags = #{tag}
|
||||
AND s.is_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="existsByElectronicTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE electronic_tags = #{tag} AND is_delete = 0
|
||||
SELECT COUNT(*)
|
||||
FROM bas_sheep
|
||||
WHERE electronic_tags = #{tag}
|
||||
AND is_delete = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,417 @@
|
||||
<?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.base.mapper.BreedRamFileMapper">
|
||||
|
||||
<resultMap type="BreedRamFile" id="BreedRamFileResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="ordinaryEarNumber" column="ordinary_ear_number" />
|
||||
<result property="ranchId" column="ranch_id" />
|
||||
<result property="ranchName" column="ranch_name" />
|
||||
<result property="sheepfoldId" column="sheepfold_id" />
|
||||
<result property="sheepfoldName" column="sheepfold_name" />
|
||||
<result property="electronicTags" column="electronic_tags" />
|
||||
<result property="varietyId" column="variety_id" />
|
||||
<result property="variety" column="variety" />
|
||||
<result property="sheepCategory" column="sheep_category" />
|
||||
<result property="currentStatus" column="current_status" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="dynamicInfo" column="dynamic_info" />
|
||||
<result property="monthAge" column="month_age" />
|
||||
<result property="birthWeight" column="birth_weight" />
|
||||
<result property="weaningDate" column="weaning_date" />
|
||||
<result property="weaningDayAge" column="weaning_day_age" />
|
||||
<result property="weaningWeight" column="weaning_weight" />
|
||||
<result property="weaningDailyGain" column="weaning_daily_gain" />
|
||||
<result property="postWeaningDailyGain" column="post_weaning_daily_gain" />
|
||||
<result property="currentWeight" column="current_weight" />
|
||||
<result property="currentWeightDate" column="current_weight_date" />
|
||||
<result property="activityLevel" column="activity_level" />
|
||||
<result property="sexualStatus" column="sexual_status" />
|
||||
<result property="scrotumCircumference" column="scrotum_circumference" />
|
||||
<result property="spermCollectionTime" column="sperm_collection_time" />
|
||||
<result property="spermVolume" column="sperm_volume" />
|
||||
<result property="spermVitality" column="sperm_vitality" />
|
||||
<result property="spermDensity" column="sperm_density" />
|
||||
<result property="spermQuality" column="sperm_quality" />
|
||||
<result property="breedingStatus" column="breeding_status" />
|
||||
<result property="lastPlanTime" column="last_plan_time" />
|
||||
<result property="currentPlanTime" column="current_plan_time" />
|
||||
<result property="remark" column="comment" />
|
||||
<result property="proteinRateEbv" column="protein_rate_ebv" />
|
||||
<result property="milkFatRateEbv" column="milk_fat_rate_ebv" />
|
||||
<result property="scsEbv" column="scs_ebv" />
|
||||
<result property="growthPerformanceEbv" column="growth_performance_ebv" />
|
||||
<result property="resistanceEbv" column="resistance_ebv" />
|
||||
<result property="reproductionPerformanceEbv" column="reproduction_performance_ebv" />
|
||||
<result property="bodyTypeEbv" column="body_type_ebv" />
|
||||
<result property="comprehensiveBreedingValue" column="comprehensive_breeding_value" />
|
||||
<result property="fatherNumber" column="father_number" />
|
||||
<result property="motherNumber" column="mother_number" />
|
||||
<result property="grandfatherNumber" column="grandfather_number" />
|
||||
<result property="grandmotherNumber" column="grandmother_number" />
|
||||
<result property="maternalGrandfatherNumber" column="maternal_grandfather_number" />
|
||||
<result property="maternalGrandmotherNumber" column="maternal_grandmother_number" />
|
||||
<result property="isCoreFlock" column="is_core_flock" />
|
||||
<result property="isBreedingUse" column="is_breeding_use" />
|
||||
<result property="pregnancyCheck" column="pregnancy_check" />
|
||||
<result property="totalMatedEwes" column="total_mated_ewes" />
|
||||
<result property="naturalPregnancyCheckEwes" column="natural_pregnancy_check_ewes" />
|
||||
<result property="naturalConceptionRate" column="natural_conception_rate" />
|
||||
<result property="artificialPregnancyCheckEwes" column="artificial_pregnancy_check_ewes" />
|
||||
<result property="artificialConceptionRate" column="artificial_conception_rate" />
|
||||
<result property="ramMotherMilkVolume" column="ram_mother_milk_volume" />
|
||||
<result property="milkProductionEbv" column="milk_production_ebv" />
|
||||
<result property="accuracy" column="accuracy" />
|
||||
<result property="informationCount" column="information_count" />
|
||||
<result property="isPaternityTested" column="is_paternity_tested" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBreedRamFileVo">
|
||||
select id, ordinary_ear_number, ranch_id, ranch_name, sheepfold_id, sheepfold_name, electronic_tags, variety_id, variety, sheep_category, current_status, birthday, dynamic_info, month_age, birth_weight, weaning_date, weaning_day_age, weaning_weight, weaning_daily_gain, post_weaning_daily_gain, current_weight, current_weight_date, activity_level, sexual_status, scrotum_circumference, sperm_collection_time, sperm_volume, sperm_vitality, sperm_density, sperm_quality, breeding_status, last_plan_time, current_plan_time, comment, protein_rate_ebv, milk_fat_rate_ebv, scs_ebv, growth_performance_ebv, resistance_ebv, reproduction_performance_ebv, body_type_ebv, comprehensive_breeding_value, father_number, mother_number, grandfather_number, grandmother_number, maternal_grandfather_number, maternal_grandmother_number, is_core_flock, is_breeding_use, pregnancy_check, total_mated_ewes, natural_pregnancy_check_ewes, natural_conception_rate, artificial_pregnancy_check_ewes, artificial_conception_rate, ram_mother_milk_volume, milk_production_ebv, accuracy, information_count, is_paternity_tested, create_by, create_time, update_by, update_time, is_delete from breed_ram_file
|
||||
</sql>
|
||||
|
||||
<select id="selectBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
<where>
|
||||
<if test="ordinaryEarNumber != null and ordinaryEarNumber != ''"> and ordinary_ear_number like concat('%', #{ordinaryEarNumber}, '%')</if>
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="ranchName != null and ranchName != ''"> and ranch_name like concat('%', #{ranchName}, '%')</if>
|
||||
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="sheepfoldName != null and sheepfoldName != ''"> and sheepfold_name like concat('%', #{sheepfoldName}, '%')</if>
|
||||
<if test="electronicTags != null and electronicTags != ''"> and electronic_tags like concat('%', #{electronicTags}, '%')</if>
|
||||
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
|
||||
<if test="variety != null and variety != ''"> and variety like concat('%', #{variety}, '%')</if>
|
||||
<if test="sheepCategory != null and sheepCategory != ''"> and sheep_category = #{sheepCategory}</if>
|
||||
<if test="currentStatus != null and currentStatus != ''"> and current_status = #{currentStatus}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="dynamicInfo != null and dynamicInfo != ''"> and dynamic_info = #{dynamicInfo}</if>
|
||||
<if test="monthAge != null "> and month_age = #{monthAge}</if>
|
||||
<if test="birthWeight != null "> and birth_weight = #{birthWeight}</if>
|
||||
<if test="weaningDate != null "> and weaning_date = #{weaningDate}</if>
|
||||
<if test="weaningDayAge != null "> and weaning_day_age = #{weaningDayAge}</if>
|
||||
<if test="weaningWeight != null "> and weaning_weight = #{weaningWeight}</if>
|
||||
<if test="weaningDailyGain != null "> and weaning_daily_gain = #{weaningDailyGain}</if>
|
||||
<if test="postWeaningDailyGain != null "> and post_weaning_daily_gain = #{postWeaningDailyGain}</if>
|
||||
<if test="currentWeight != null "> and current_weight = #{currentWeight}</if>
|
||||
<if test="currentWeightDate != null "> and current_weight_date = #{currentWeightDate}</if>
|
||||
<if test="activityLevel != null and activityLevel != ''"> and activity_level = #{activityLevel}</if>
|
||||
<if test="sexualStatus != null and sexualStatus != ''"> and sexual_status = #{sexualStatus}</if>
|
||||
<if test="scrotumCircumference != null "> and scrotum_circumference = #{scrotumCircumference}</if>
|
||||
<if test="spermCollectionTime != null "> and sperm_collection_time = #{spermCollectionTime}</if>
|
||||
<if test="spermVolume != null "> and sperm_volume = #{spermVolume}</if>
|
||||
<if test="spermVitality != null and spermVitality != ''"> and sperm_vitality = #{spermVitality}</if>
|
||||
<if test="spermDensity != null and spermDensity != ''"> and sperm_density = #{spermDensity}</if>
|
||||
<if test="spermQuality != null and spermQuality != ''"> and sperm_quality = #{spermQuality}</if>
|
||||
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
|
||||
<if test="lastPlanTime != null "> and last_plan_time = #{lastPlanTime}</if>
|
||||
<if test="currentPlanTime != null "> and current_plan_time = #{currentPlanTime}</if>
|
||||
<if test="proteinRateEbv != null "> and protein_rate_ebv = #{proteinRateEbv}</if>
|
||||
<if test="milkFatRateEbv != null "> and milk_fat_rate_ebv = #{milkFatRateEbv}</if>
|
||||
<if test="scsEbv != null "> and scs_ebv = #{scsEbv}</if>
|
||||
<if test="growthPerformanceEbv != null "> and growth_performance_ebv = #{growthPerformanceEbv}</if>
|
||||
<if test="resistanceEbv != null "> and resistance_ebv = #{resistanceEbv}</if>
|
||||
<if test="reproductionPerformanceEbv != null "> and reproduction_performance_ebv = #{reproductionPerformanceEbv}</if>
|
||||
<if test="bodyTypeEbv != null "> and body_type_ebv = #{bodyTypeEbv}</if>
|
||||
<if test="comprehensiveBreedingValue != null "> and comprehensive_breeding_value = #{comprehensiveBreedingValue}</if>
|
||||
<if test="fatherNumber != null and fatherNumber != ''"> and father_number = #{fatherNumber}</if>
|
||||
<if test="motherNumber != null and motherNumber != ''"> and mother_number = #{motherNumber}</if>
|
||||
<if test="grandfatherNumber != null and grandfatherNumber != ''"> and grandfather_number = #{grandfatherNumber}</if>
|
||||
<if test="grandmotherNumber != null and grandmotherNumber != ''"> and grandmother_number = #{grandmotherNumber}</if>
|
||||
<if test="maternalGrandfatherNumber != null and maternalGrandfatherNumber != ''"> and maternal_grandfather_number = #{maternalGrandfatherNumber}</if>
|
||||
<if test="maternalGrandmotherNumber != null and maternalGrandmotherNumber != ''"> and maternal_grandmother_number = #{maternalGrandmotherNumber}</if>
|
||||
<if test="isCoreFlock != null "> and is_core_flock = #{isCoreFlock}</if>
|
||||
<if test="isBreedingUse != null "> and is_breeding_use = #{isBreedingUse}</if>
|
||||
<if test="pregnancyCheck != null and pregnancyCheck != ''"> and pregnancy_check = #{pregnancyCheck}</if>
|
||||
<if test="totalMatedEwes != null "> and total_mated_ewes = #{totalMatedEwes}</if>
|
||||
<if test="naturalPregnancyCheckEwes != null "> and natural_pregnancy_check_ewes = #{naturalPregnancyCheckEwes}</if>
|
||||
<if test="naturalConceptionRate != null "> and natural_conception_rate = #{naturalConceptionRate}</if>
|
||||
<if test="artificialPregnancyCheckEwes != null "> and artificial_pregnancy_check_ewes = #{artificialPregnancyCheckEwes}</if>
|
||||
<if test="artificialConceptionRate != null "> and artificial_conception_rate = #{artificialConceptionRate}</if>
|
||||
<if test="ramMotherMilkVolume != null "> and ram_mother_milk_volume = #{ramMotherMilkVolume}</if>
|
||||
<if test="milkProductionEbv != null "> and milk_production_ebv = #{milkProductionEbv}</if>
|
||||
<if test="accuracy != null "> and accuracy = #{accuracy}</if>
|
||||
<if test="informationCount != null "> and information_count = #{informationCount}</if>
|
||||
<if test="isPaternityTested != null "> and is_paternity_tested = #{isPaternityTested}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBreedRamFileById" parameterType="Long" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectBreedRamFileByOrdinaryEarNumber" parameterType="String" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
where ordinary_ear_number = #{ordinaryEarNumber}
|
||||
</select>
|
||||
|
||||
<select id="selectBreedRamFileByElectronicTags" parameterType="String" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
where electronic_tags = #{electronicTags}
|
||||
</select>
|
||||
|
||||
<select id="selectBreedRamFileListByRanchId" parameterType="Long" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
where ranch_id = #{ranchId} and (is_delete = 0 or is_delete is null)
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBreedRamFileListBySheepfoldId" parameterType="Long" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
where sheepfold_id = #{sheepfoldId} and (is_delete = 0 or is_delete is null)
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoreFlockBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
<where>
|
||||
is_core_flock = 1
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
|
||||
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBreedingUseBreedRamFileList" parameterType="BreedRamFile" resultMap="BreedRamFileResult">
|
||||
<include refid="selectBreedRamFileVo"/>
|
||||
<where>
|
||||
is_breeding_use = 1
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
|
||||
<if test="breedingStatus != null "> and breeding_status = #{breedingStatus}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertBreedRamFile" parameterType="BreedRamFile" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into breed_ram_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ordinaryEarNumber != null">ordinary_ear_number,</if>
|
||||
<if test="ranchId != null">ranch_id,</if>
|
||||
<if test="ranchName != null">ranch_name,</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id,</if>
|
||||
<if test="sheepfoldName != null">sheepfold_name,</if>
|
||||
<if test="electronicTags != null">electronic_tags,</if>
|
||||
<if test="varietyId != null">variety_id,</if>
|
||||
<if test="variety != null">variety,</if>
|
||||
<if test="sheepCategory != null">sheep_category,</if>
|
||||
<if test="currentStatus != null">current_status,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="dynamicInfo != null">dynamic_info,</if>
|
||||
<if test="monthAge != null">month_age,</if>
|
||||
<if test="birthWeight != null">birth_weight,</if>
|
||||
<if test="weaningDate != null">weaning_date,</if>
|
||||
<if test="weaningDayAge != null">weaning_day_age,</if>
|
||||
<if test="weaningWeight != null">weaning_weight,</if>
|
||||
<if test="weaningDailyGain != null">weaning_daily_gain,</if>
|
||||
<if test="postWeaningDailyGain != null">post_weaning_daily_gain,</if>
|
||||
<if test="currentWeight != null">current_weight,</if>
|
||||
<if test="currentWeightDate != null">current_weight_date,</if>
|
||||
<if test="activityLevel != null">activity_level,</if>
|
||||
<if test="sexualStatus != null">sexual_status,</if>
|
||||
<if test="scrotumCircumference != null">scrotum_circumference,</if>
|
||||
<if test="spermCollectionTime != null">sperm_collection_time,</if>
|
||||
<if test="spermVolume != null">sperm_volume,</if>
|
||||
<if test="spermVitality != null">sperm_vitality,</if>
|
||||
<if test="spermDensity != null">sperm_density,</if>
|
||||
<if test="spermQuality != null">sperm_quality,</if>
|
||||
<if test="breedingStatus != null">breeding_status,</if>
|
||||
<if test="lastPlanTime != null">last_plan_time,</if>
|
||||
<if test="currentPlanTime != null">current_plan_time,</if>
|
||||
<if test="remark != null">comment,</if>
|
||||
<if test="proteinRateEbv != null">protein_rate_ebv,</if>
|
||||
<if test="milkFatRateEbv != null">milk_fat_rate_ebv,</if>
|
||||
<if test="scsEbv != null">scs_ebv,</if>
|
||||
<if test="growthPerformanceEbv != null">growth_performance_ebv,</if>
|
||||
<if test="resistanceEbv != null">resistance_ebv,</if>
|
||||
<if test="reproductionPerformanceEbv != null">reproduction_performance_ebv,</if>
|
||||
<if test="bodyTypeEbv != null">body_type_ebv,</if>
|
||||
<if test="comprehensiveBreedingValue != null">comprehensive_breeding_value,</if>
|
||||
<if test="fatherNumber != null">father_number,</if>
|
||||
<if test="motherNumber != null">mother_number,</if>
|
||||
<if test="grandfatherNumber != null">grandfather_number,</if>
|
||||
<if test="grandmotherNumber != null">grandmother_number,</if>
|
||||
<if test="maternalGrandfatherNumber != null">maternal_grandfather_number,</if>
|
||||
<if test="maternalGrandmotherNumber != null">maternal_grandmother_number,</if>
|
||||
<if test="isCoreFlock != null">is_core_flock,</if>
|
||||
<if test="isBreedingUse != null">is_breeding_use,</if>
|
||||
<if test="pregnancyCheck != null">pregnancy_check,</if>
|
||||
<if test="totalMatedEwes != null">total_mated_ewes,</if>
|
||||
<if test="naturalPregnancyCheckEwes != null">natural_pregnancy_check_ewes,</if>
|
||||
<if test="naturalConceptionRate != null">natural_conception_rate,</if>
|
||||
<if test="artificialPregnancyCheckEwes != null">artificial_pregnancy_check_ewes,</if>
|
||||
<if test="artificialConceptionRate != null">artificial_conception_rate,</if>
|
||||
<if test="ramMotherMilkVolume != null">ram_mother_milk_volume,</if>
|
||||
<if test="milkProductionEbv != null">milk_production_ebv,</if>
|
||||
<if test="accuracy != null">accuracy,</if>
|
||||
<if test="informationCount != null">information_count,</if>
|
||||
<if test="isPaternityTested != null">is_paternity_tested,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ordinaryEarNumber != null">#{ordinaryEarNumber},</if>
|
||||
<if test="ranchId != null">#{ranchId},</if>
|
||||
<if test="ranchName != null">#{ranchName},</if>
|
||||
<if test="sheepfoldId != null">#{sheepfoldId},</if>
|
||||
<if test="sheepfoldName != null">#{sheepfoldName},</if>
|
||||
<if test="electronicTags != null">#{electronicTags},</if>
|
||||
<if test="varietyId != null">#{varietyId},</if>
|
||||
<if test="variety != null">#{variety},</if>
|
||||
<if test="sheepCategory != null">#{sheepCategory},</if>
|
||||
<if test="currentStatus != null">#{currentStatus},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="dynamicInfo != null">#{dynamicInfo},</if>
|
||||
<if test="monthAge != null">#{monthAge},</if>
|
||||
<if test="birthWeight != null">#{birthWeight},</if>
|
||||
<if test="weaningDate != null">#{weaningDate},</if>
|
||||
<if test="weaningDayAge != null">#{weaningDayAge},</if>
|
||||
<if test="weaningWeight != null">#{weaningWeight},</if>
|
||||
<if test="weaningDailyGain != null">#{weaningDailyGain},</if>
|
||||
<if test="postWeaningDailyGain != null">#{postWeaningDailyGain},</if>
|
||||
<if test="currentWeight != null">#{currentWeight},</if>
|
||||
<if test="currentWeightDate != null">#{currentWeightDate},</if>
|
||||
<if test="activityLevel != null">#{activityLevel},</if>
|
||||
<if test="sexualStatus != null">#{sexualStatus},</if>
|
||||
<if test="scrotumCircumference != null">#{scrotumCircumference},</if>
|
||||
<if test="spermCollectionTime != null">#{spermCollectionTime},</if>
|
||||
<if test="spermVolume != null">#{spermVolume},</if>
|
||||
<if test="spermVitality != null">#{spermVitality},</if>
|
||||
<if test="spermDensity != null">#{spermDensity},</if>
|
||||
<if test="spermQuality != null">#{spermQuality},</if>
|
||||
<if test="breedingStatus != null">#{breedingStatus},</if>
|
||||
<if test="lastPlanTime != null">#{lastPlanTime},</if>
|
||||
<if test="currentPlanTime != null">#{currentPlanTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="proteinRateEbv != null">#{proteinRateEbv},</if>
|
||||
<if test="milkFatRateEbv != null">#{milkFatRateEbv},</if>
|
||||
<if test="scsEbv != null">#{scsEbv},</if>
|
||||
<if test="growthPerformanceEbv != null">#{growthPerformanceEbv},</if>
|
||||
<if test="resistanceEbv != null">#{resistanceEbv},</if>
|
||||
<if test="reproductionPerformanceEbv != null">#{reproductionPerformanceEbv},</if>
|
||||
<if test="bodyTypeEbv != null">#{bodyTypeEbv},</if>
|
||||
<if test="comprehensiveBreedingValue != null">#{comprehensiveBreedingValue},</if>
|
||||
<if test="fatherNumber != null">#{fatherNumber},</if>
|
||||
<if test="motherNumber != null">#{motherNumber},</if>
|
||||
<if test="grandfatherNumber != null">#{grandfatherNumber},</if>
|
||||
<if test="grandmotherNumber != null">#{grandmotherNumber},</if>
|
||||
<if test="maternalGrandfatherNumber != null">#{maternalGrandfatherNumber},</if>
|
||||
<if test="maternalGrandmotherNumber != null">#{maternalGrandmotherNumber},</if>
|
||||
<if test="isCoreFlock != null">#{isCoreFlock},</if>
|
||||
<if test="isBreedingUse != null">#{isBreedingUse},</if>
|
||||
<if test="pregnancyCheck != null">#{pregnancyCheck},</if>
|
||||
<if test="totalMatedEwes != null">#{totalMatedEwes},</if>
|
||||
<if test="naturalPregnancyCheckEwes != null">#{naturalPregnancyCheckEwes},</if>
|
||||
<if test="naturalConceptionRate != null">#{naturalConceptionRate},</if>
|
||||
<if test="artificialPregnancyCheckEwes != null">#{artificialPregnancyCheckEwes},</if>
|
||||
<if test="artificialConceptionRate != null">#{artificialConceptionRate},</if>
|
||||
<if test="ramMotherMilkVolume != null">#{ramMotherMilkVolume},</if>
|
||||
<if test="milkProductionEbv != null">#{milkProductionEbv},</if>
|
||||
<if test="accuracy != null">#{accuracy},</if>
|
||||
<if test="informationCount != null">#{informationCount},</if>
|
||||
<if test="isPaternityTested != null">#{isPaternityTested},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBreedRamFile" parameterType="BreedRamFile">
|
||||
update breed_ram_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ordinaryEarNumber != null">ordinary_ear_number = #{ordinaryEarNumber},</if>
|
||||
<if test="ranchId != null">ranch_id = #{ranchId},</if>
|
||||
<if test="ranchName != null">ranch_name = #{ranchName},</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
|
||||
<if test="sheepfoldName != null">sheepfold_name = #{sheepfoldName},</if>
|
||||
<if test="electronicTags != null">electronic_tags = #{electronicTags},</if>
|
||||
<if test="varietyId != null">variety_id = #{varietyId},</if>
|
||||
<if test="variety != null">variety = #{variety},</if>
|
||||
<if test="sheepCategory != null">sheep_category = #{sheepCategory},</if>
|
||||
<if test="currentStatus != null">current_status = #{currentStatus},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="dynamicInfo != null">dynamic_info = #{dynamicInfo},</if>
|
||||
<if test="monthAge != null">month_age = #{monthAge},</if>
|
||||
<if test="birthWeight != null">birth_weight = #{birthWeight},</if>
|
||||
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>
|
||||
<if test="weaningDayAge != null">weaning_day_age = #{weaningDayAge},</if>
|
||||
<if test="weaningWeight != null">weaning_weight = #{weaningWeight},</if>
|
||||
<if test="weaningDailyGain != null">weaning_daily_gain = #{weaningDailyGain},</if>
|
||||
<if test="postWeaningDailyGain != null">post_weaning_daily_gain = #{postWeaningDailyGain},</if>
|
||||
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
|
||||
<if test="currentWeightDate != null">current_weight_date = #{currentWeightDate},</if>
|
||||
<if test="activityLevel != null">activity_level = #{activityLevel},</if>
|
||||
<if test="sexualStatus != null">sexual_status = #{sexualStatus},</if>
|
||||
<if test="scrotumCircumference != null">scrotum_circumference = #{scrotumCircumference},</if>
|
||||
<if test="spermCollectionTime != null">sperm_collection_time = #{spermCollectionTime},</if>
|
||||
<if test="spermVolume != null">sperm_volume = #{spermVolume},</if>
|
||||
<if test="spermVitality != null">sperm_vitality = #{spermVitality},</if>
|
||||
<if test="spermDensity != null">sperm_density = #{spermDensity},</if>
|
||||
<if test="spermQuality != null">sperm_quality = #{spermQuality},</if>
|
||||
<if test="breedingStatus != null">breeding_status = #{breedingStatus},</if>
|
||||
<if test="lastPlanTime != null">last_plan_time = #{lastPlanTime},</if>
|
||||
<if test="currentPlanTime != null">current_plan_time = #{currentPlanTime},</if>
|
||||
<if test="remark != null">comment = #{remark},</if>
|
||||
<if test="proteinRateEbv != null">protein_rate_ebv = #{proteinRateEbv},</if>
|
||||
<if test="milkFatRateEbv != null">milk_fat_rate_ebv = #{milkFatRateEbv},</if>
|
||||
<if test="scsEbv != null">scs_ebv = #{scsEbv},</if>
|
||||
<if test="growthPerformanceEbv != null">growth_performance_ebv = #{growthPerformanceEbv},</if>
|
||||
<if test="resistanceEbv != null">resistance_ebv = #{resistanceEbv},</if>
|
||||
<if test="reproductionPerformanceEbv != null">reproduction_performance_ebv = #{reproductionPerformanceEbv},</if>
|
||||
<if test="bodyTypeEbv != null">body_type_ebv = #{bodyTypeEbv},</if>
|
||||
<if test="comprehensiveBreedingValue != null">comprehensive_breeding_value = #{comprehensiveBreedingValue},</if>
|
||||
<if test="fatherNumber != null">father_number = #{fatherNumber},</if>
|
||||
<if test="motherNumber != null">mother_number = #{motherNumber},</if>
|
||||
<if test="grandfatherNumber != null">grandfather_number = #{grandfatherNumber},</if>
|
||||
<if test="grandmotherNumber != null">grandmother_number = #{grandmotherNumber},</if>
|
||||
<if test="maternalGrandfatherNumber != null">maternal_grandfather_number = #{maternalGrandfatherNumber},</if>
|
||||
<if test="maternalGrandmotherNumber != null">maternal_grandmother_number = #{maternalGrandmotherNumber},</if>
|
||||
<if test="isCoreFlock != null">is_core_flock = #{isCoreFlock},</if>
|
||||
<if test="isBreedingUse != null">is_breeding_use = #{isBreedingUse},</if>
|
||||
<if test="pregnancyCheck != null">pregnancy_check = #{pregnancyCheck},</if>
|
||||
<if test="totalMatedEwes != null">total_mated_ewes = #{totalMatedEwes},</if>
|
||||
<if test="naturalPregnancyCheckEwes != null">natural_pregnancy_check_ewes = #{naturalPregnancyCheckEwes},</if>
|
||||
<if test="naturalConceptionRate != null">natural_conception_rate = #{naturalConceptionRate},</if>
|
||||
<if test="artificialPregnancyCheckEwes != null">artificial_pregnancy_check_ewes = #{artificialPregnancyCheckEwes},</if>
|
||||
<if test="artificialConceptionRate != null">artificial_conception_rate = #{artificialConceptionRate},</if>
|
||||
<if test="ramMotherMilkVolume != null">ram_mother_milk_volume = #{ramMotherMilkVolume},</if>
|
||||
<if test="milkProductionEbv != null">milk_production_ebv = #{milkProductionEbv},</if>
|
||||
<if test="accuracy != null">accuracy = #{accuracy},</if>
|
||||
<if test="informationCount != null">information_count = #{informationCount},</if>
|
||||
<if test="isPaternityTested != null">is_paternity_tested = #{isPaternityTested},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBreedRamFileById" parameterType="Long">
|
||||
delete from breed_ram_file where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBreedRamFileByIds" parameterType="String">
|
||||
delete from breed_ram_file where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.SgFeedDetailsMapper">
|
||||
|
||||
<resultMap type="SgFeedDetails" id="SgFeedDetailsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="fodder" column="fodder" />
|
||||
<result property="number" column="number" />
|
||||
<result property="nuit" column="nuit" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFeedDetailsVo">
|
||||
select id, fodder, number, nuit from sg_feed_details
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFeedDetailsList" parameterType="SgFeedDetails" resultMap="SgFeedDetailsResult">
|
||||
<include refid="selectSgFeedDetailsVo"/>
|
||||
<where>
|
||||
<if test="fodder != null and fodder != ''"> and fodder = #{fodder}</if>
|
||||
<if test="number != null "> and number = #{number}</if>
|
||||
<if test="nuit != null and nuit != ''"> and nuit = #{nuit}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFeedDetailsById" parameterType="Long" resultMap="SgFeedDetailsResult">
|
||||
<include refid="selectSgFeedDetailsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFeedDetails" parameterType="SgFeedDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sg_feed_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fodder != null">fodder,</if>
|
||||
<if test="number != null">number,</if>
|
||||
<if test="nuit != null">nuit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="fodder != null">#{fodder},</if>
|
||||
<if test="number != null">#{number},</if>
|
||||
<if test="nuit != null">#{nuit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFeedDetails" parameterType="SgFeedDetails">
|
||||
update sg_feed_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fodder != null">fodder = #{fodder},</if>
|
||||
<if test="number != null">number = #{number},</if>
|
||||
<if test="nuit != null">nuit = #{nuit},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFeedDetailsById" parameterType="Long">
|
||||
delete from sg_feed_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFeedDetailsByIds" parameterType="String">
|
||||
delete from sg_feed_details where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
129
zhyc-module/src/main/resources/mapper/feed/SgFeedInfoMapper.xml
Normal file
129
zhyc-module/src/main/resources/mapper/feed/SgFeedInfoMapper.xml
Normal file
@@ -0,0 +1,129 @@
|
||||
<?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.SgFeedInfoMapper">
|
||||
|
||||
<resultMap type="SgFeedInfo" id="SgFeedInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="formulaId" column="formula_id" />
|
||||
<result property="sheepfoldId" column="sheepfold_id" />
|
||||
<result property="average" column="average" />
|
||||
<result property="planMonring" column="plan_monring" />
|
||||
<result property="actualMonring" column="actual_monring" />
|
||||
<result property="planNoon" column="plan_noon" />
|
||||
<result property="actualNoon" column="actual_noon" />
|
||||
<result property="planEvenig" column="plan_evenig" />
|
||||
<result property="actualEvening" column="actual_evening" />
|
||||
<result property="particle" column="particle" />
|
||||
<result property="other" column="other" />
|
||||
<result property="replenish" column="replenish" />
|
||||
<result property="planDate" column="plan_date" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFeedInfoVo">
|
||||
select id, formula_id, sheepfold_id, average, plan_monring, actual_monring, plan_noon, actual_noon, plan_evenig, actual_evening, particle, other, replenish, plan_date, comment, create_by, create_time from sg_feed_info
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFeedInfoList" parameterType="SgFeedInfo" resultMap="SgFeedInfoResult">
|
||||
<include refid="selectSgFeedInfoVo"/>
|
||||
<where>
|
||||
<if test="formulaId != null "> and formula_id = #{formulaId}</if>
|
||||
<if test="sheepfoldId != null and sheepfoldId != ''"> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="average != null "> and average = #{average}</if>
|
||||
<if test="planMonring != null "> and plan_monring = #{planMonring}</if>
|
||||
<if test="actualMonring != null "> and actual_monring = #{actualMonring}</if>
|
||||
<if test="planNoon != null "> and plan_noon = #{planNoon}</if>
|
||||
<if test="actualNoon != null "> and actual_noon = #{actualNoon}</if>
|
||||
<if test="planEvenig != null "> and plan_evenig = #{planEvenig}</if>
|
||||
<if test="actualEvening != null "> and actual_evening = #{actualEvening}</if>
|
||||
<if test="particle != null "> and particle = #{particle}</if>
|
||||
<if test="other != null "> and other = #{other}</if>
|
||||
<if test="replenish != null "> and replenish = #{replenish}</if>
|
||||
<if test="planDate != null "> and plan_date = #{planDate}</if>
|
||||
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFeedInfoById" parameterType="Long" resultMap="SgFeedInfoResult">
|
||||
<include refid="selectSgFeedInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFeedInfo" parameterType="SgFeedInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sg_feed_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="formulaId != null">formula_id,</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id,</if>
|
||||
<if test="average != null">average,</if>
|
||||
<if test="planMonring != null">plan_monring,</if>
|
||||
<if test="actualMonring != null">actual_monring,</if>
|
||||
<if test="planNoon != null">plan_noon,</if>
|
||||
<if test="actualNoon != null">actual_noon,</if>
|
||||
<if test="planEvenig != null">plan_evenig,</if>
|
||||
<if test="actualEvening != null">actual_evening,</if>
|
||||
<if test="particle != null">particle,</if>
|
||||
<if test="other != null">other,</if>
|
||||
<if test="replenish != null">replenish,</if>
|
||||
<if test="planDate != null">plan_date,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="formulaId != null">#{formulaId},</if>
|
||||
<if test="sheepfoldId != null">#{sheepfoldId},</if>
|
||||
<if test="average != null">#{average},</if>
|
||||
<if test="planMonring != null">#{planMonring},</if>
|
||||
<if test="actualMonring != null">#{actualMonring},</if>
|
||||
<if test="planNoon != null">#{planNoon},</if>
|
||||
<if test="actualNoon != null">#{actualNoon},</if>
|
||||
<if test="planEvenig != null">#{planEvenig},</if>
|
||||
<if test="actualEvening != null">#{actualEvening},</if>
|
||||
<if test="particle != null">#{particle},</if>
|
||||
<if test="other != null">#{other},</if>
|
||||
<if test="replenish != null">#{replenish},</if>
|
||||
<if test="planDate != null">#{planDate},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFeedInfo" parameterType="SgFeedInfo">
|
||||
update sg_feed_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formulaId != null">formula_id = #{formulaId},</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
|
||||
<if test="average != null">average = #{average},</if>
|
||||
<if test="planMonring != null">plan_monring = #{planMonring},</if>
|
||||
<if test="actualMonring != null">actual_monring = #{actualMonring},</if>
|
||||
<if test="planNoon != null">plan_noon = #{planNoon},</if>
|
||||
<if test="actualNoon != null">actual_noon = #{actualNoon},</if>
|
||||
<if test="planEvenig != null">plan_evenig = #{planEvenig},</if>
|
||||
<if test="actualEvening != null">actual_evening = #{actualEvening},</if>
|
||||
<if test="particle != null">particle = #{particle},</if>
|
||||
<if test="other != null">other = #{other},</if>
|
||||
<if test="replenish != null">replenish = #{replenish},</if>
|
||||
<if test="planDate != null">plan_date = #{planDate},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFeedInfoById" parameterType="Long">
|
||||
delete from sg_feed_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFeedInfoByIds" parameterType="String">
|
||||
delete from sg_feed_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
137
zhyc-module/src/main/resources/mapper/feed/SgFeedPlanMapper.xml
Normal file
137
zhyc-module/src/main/resources/mapper/feed/SgFeedPlanMapper.xml
Normal file
@@ -0,0 +1,137 @@
|
||||
<?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.SgFeedPlanMapper">
|
||||
|
||||
<resultMap type="SgFeedPlan" id="SgFeedPlanResult">
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="formulaId" column="formula_id" />
|
||||
<result property="sheepHouseId" column="sheep_house_id" />
|
||||
<result property="sheepCount" column="sheep_count" />
|
||||
<result property="planDailySize" column="plan_daily_size" />
|
||||
<result property="planMorningSize" column="plan_morning_size" />
|
||||
<result property="planMorningTotal" column="plan_morning_total" />
|
||||
<result property="ratioMorning" column="ratio_morning" />
|
||||
<result property="actualMorningSize" column="actual_morning_size" />
|
||||
<result property="planNoonSize" column="plan_noon_size" />
|
||||
<result property="planNoonTotal" column="plan_noon_total" />
|
||||
<result property="actualNoonSize" column="actual_noon_size" />
|
||||
<result property="ratioNoon" column="ratio_noon" />
|
||||
<result property="planAfternoonSize" column="plan_afternoon_size" />
|
||||
<result property="planAfternoonTotal" column="plan_afternoon_total" />
|
||||
<result property="actualAfternoonSize" column="actual_afternoon_size" />
|
||||
<result property="ratioAfternoon" column="ratio_afternoon" />
|
||||
<result property="planFeedTotal" column="plan_feed_total" />
|
||||
<result property="zookeeper" column="zookeeper" />
|
||||
<result property="planDate" column="plan_date" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFeedPlanVo">
|
||||
select create_date, formula_id, sheep_house_id, sheep_count, plan_daily_size, plan_morning_size, plan_morning_total, ratio_morning, actual_morning_size, plan_noon_size, plan_noon_total, actual_noon_size, ratio_noon, plan_afternoon_size, plan_afternoon_total, actual_afternoon_size, ratio_afternoon, plan_feed_total, zookeeper, plan_date, remark from sg_feed_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFeedPlanList" parameterType="SgFeedPlan" resultMap="SgFeedPlanResult">
|
||||
<include refid="selectSgFeedPlanVo"/>
|
||||
<where>
|
||||
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
|
||||
<if test="sheepHouseId != null "> and sheep_house_id = #{sheepHouseId}</if>
|
||||
<if test="zookeeper != null and zookeeper != ''"> and zookeeper = #{zookeeper}</if>
|
||||
<if test="planDate != null "> and plan_date = #{planDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFeedPlanByCreateDate" parameterType="Date" resultMap="SgFeedPlanResult">
|
||||
<include refid="selectSgFeedPlanVo"/>
|
||||
where create_date = #{createDate}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFeedPlan" parameterType="SgFeedPlan">
|
||||
insert into sg_feed_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="formulaId != null and formulaId != ''">formula_id,</if>
|
||||
<if test="sheepHouseId != null">sheep_house_id,</if>
|
||||
<if test="sheepCount != null">sheep_count,</if>
|
||||
<if test="planDailySize != null">plan_daily_size,</if>
|
||||
<if test="planMorningSize != null">plan_morning_size,</if>
|
||||
<if test="planMorningTotal != null">plan_morning_total,</if>
|
||||
<if test="ratioMorning != null">ratio_morning,</if>
|
||||
<if test="actualMorningSize != null">actual_morning_size,</if>
|
||||
<if test="planNoonSize != null">plan_noon_size,</if>
|
||||
<if test="planNoonTotal != null">plan_noon_total,</if>
|
||||
<if test="actualNoonSize != null">actual_noon_size,</if>
|
||||
<if test="ratioNoon != null">ratio_noon,</if>
|
||||
<if test="planAfternoonSize != null">plan_afternoon_size,</if>
|
||||
<if test="planAfternoonTotal != null">plan_afternoon_total,</if>
|
||||
<if test="actualAfternoonSize != null">actual_afternoon_size,</if>
|
||||
<if test="ratioAfternoon != null">ratio_afternoon,</if>
|
||||
<if test="planFeedTotal != null">plan_feed_total,</if>
|
||||
<if test="zookeeper != null">zookeeper,</if>
|
||||
<if test="planDate != null">plan_date,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
|
||||
<if test="sheepHouseId != null">#{sheepHouseId},</if>
|
||||
<if test="sheepCount != null">#{sheepCount},</if>
|
||||
<if test="planDailySize != null">#{planDailySize},</if>
|
||||
<if test="planMorningSize != null">#{planMorningSize},</if>
|
||||
<if test="planMorningTotal != null">#{planMorningTotal},</if>
|
||||
<if test="ratioMorning != null">#{ratioMorning},</if>
|
||||
<if test="actualMorningSize != null">#{actualMorningSize},</if>
|
||||
<if test="planNoonSize != null">#{planNoonSize},</if>
|
||||
<if test="planNoonTotal != null">#{planNoonTotal},</if>
|
||||
<if test="actualNoonSize != null">#{actualNoonSize},</if>
|
||||
<if test="ratioNoon != null">#{ratioNoon},</if>
|
||||
<if test="planAfternoonSize != null">#{planAfternoonSize},</if>
|
||||
<if test="planAfternoonTotal != null">#{planAfternoonTotal},</if>
|
||||
<if test="actualAfternoonSize != null">#{actualAfternoonSize},</if>
|
||||
<if test="ratioAfternoon != null">#{ratioAfternoon},</if>
|
||||
<if test="planFeedTotal != null">#{planFeedTotal},</if>
|
||||
<if test="zookeeper != null">#{zookeeper},</if>
|
||||
<if test="planDate != null">#{planDate},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFeedPlan" parameterType="SgFeedPlan">
|
||||
update sg_feed_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formulaId != null and formulaId != ''">formula_id = #{formulaId},</if>
|
||||
<if test="sheepHouseId != null">sheep_house_id = #{sheepHouseId},</if>
|
||||
<if test="sheepCount != null">sheep_count = #{sheepCount},</if>
|
||||
<if test="planDailySize != null">plan_daily_size = #{planDailySize},</if>
|
||||
<if test="planMorningSize != null">plan_morning_size = #{planMorningSize},</if>
|
||||
<if test="planMorningTotal != null">plan_morning_total = #{planMorningTotal},</if>
|
||||
<if test="ratioMorning != null">ratio_morning = #{ratioMorning},</if>
|
||||
<if test="actualMorningSize != null">actual_morning_size = #{actualMorningSize},</if>
|
||||
<if test="planNoonSize != null">plan_noon_size = #{planNoonSize},</if>
|
||||
<if test="planNoonTotal != null">plan_noon_total = #{planNoonTotal},</if>
|
||||
<if test="actualNoonSize != null">actual_noon_size = #{actualNoonSize},</if>
|
||||
<if test="ratioNoon != null">ratio_noon = #{ratioNoon},</if>
|
||||
<if test="planAfternoonSize != null">plan_afternoon_size = #{planAfternoonSize},</if>
|
||||
<if test="planAfternoonTotal != null">plan_afternoon_total = #{planAfternoonTotal},</if>
|
||||
<if test="actualAfternoonSize != null">actual_afternoon_size = #{actualAfternoonSize},</if>
|
||||
<if test="ratioAfternoon != null">ratio_afternoon = #{ratioAfternoon},</if>
|
||||
<if test="planFeedTotal != null">plan_feed_total = #{planFeedTotal},</if>
|
||||
<if test="zookeeper != null">zookeeper = #{zookeeper},</if>
|
||||
<if test="planDate != null">plan_date = #{planDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where create_date = #{createDate}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFeedPlanByCreateDate" parameterType="Date">
|
||||
delete from sg_feed_plan where create_date = #{createDate}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFeedPlanByCreateDates" parameterType="String">
|
||||
delete from sg_feed_plan where create_date in
|
||||
<foreach item="createDate" collection="array" open="(" separator="," close=")">
|
||||
#{createDate}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.SgFeedRatioMapper">
|
||||
|
||||
<resultMap type="SgFeedRatio" id="SgFeedRatioResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="morning" column="morning" />
|
||||
<result property="noon" column="noon" />
|
||||
<result property="evening" column="evening" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFeedRatioVo">
|
||||
select id, morning, noon, evening from sg_feed_ratio
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFeedRatioList" parameterType="SgFeedRatio" resultMap="SgFeedRatioResult">
|
||||
<include refid="selectSgFeedRatioVo"/>
|
||||
<where>
|
||||
<if test="morning != null and morning != ''"> and morning = #{morning}</if>
|
||||
<if test="noon != null and noon != ''"> and noon = #{noon}</if>
|
||||
<if test="evening != null and evening != ''"> and evening = #{evening}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFeedRatioById" parameterType="Long" resultMap="SgFeedRatioResult">
|
||||
<include refid="selectSgFeedRatioVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFeedRatio" parameterType="SgFeedRatio" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sg_feed_ratio
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="morning != null">morning,</if>
|
||||
<if test="noon != null">noon,</if>
|
||||
<if test="evening != null">evening,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="morning != null">#{morning},</if>
|
||||
<if test="noon != null">#{noon},</if>
|
||||
<if test="evening != null">#{evening},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFeedRatio" parameterType="SgFeedRatio">
|
||||
update sg_feed_ratio
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="morning != null">morning = #{morning},</if>
|
||||
<if test="noon != null">noon = #{noon},</if>
|
||||
<if test="evening != null">evening = #{evening},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFeedRatioById" parameterType="Long">
|
||||
delete from sg_feed_ratio where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFeedRatioByIds" parameterType="String">
|
||||
delete from sg_feed_ratio where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.SgFodderMapper">
|
||||
|
||||
<resultMap type="SgFodder" id="SgFodderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="fodderType" column="fodder_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFodderVo">
|
||||
select id, name, fodder_type from sg_fodder
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFodderList" parameterType="SgFodder" resultMap="SgFodderResult">
|
||||
<include refid="selectSgFodderVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="fodderType != null "> and fodder_type = #{fodderType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFodderById" parameterType="Long" resultMap="SgFodderResult">
|
||||
<include refid="selectSgFodderVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFodder" parameterType="SgFodder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sg_fodder
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="fodderType != null">fodder_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="fodderType != null">#{fodderType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFodder" parameterType="SgFodder">
|
||||
update sg_fodder
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="fodderType != null">fodder_type = #{fodderType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFodderById" parameterType="Long">
|
||||
delete from sg_fodder where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFodderByIds" parameterType="String">
|
||||
delete from sg_fodder where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.SgFormulaListMapper">
|
||||
|
||||
<resultMap type="SgFormulaList" id="SgFormulaListResult">
|
||||
<result property="code" column="code" />
|
||||
<result property="formulaId" column="formula_id" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="ratio" column="ratio" />
|
||||
<result property="isGranular" column="is_granular" />
|
||||
<result property="isSupplement" column="is_supplement" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFormulaListVo">
|
||||
select code, formula_id, material_id, material_name, ratio, is_granular, is_supplement from sg_formula_list
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFormulaListList" parameterType="SgFormulaList" resultMap="SgFormulaListResult">
|
||||
<include refid="selectSgFormulaListVo"/>
|
||||
<where>
|
||||
<if test="materialId != null and materialId != ''">material_id = #{materialId}</if>
|
||||
<if test="formulaId != null and formulaId != ''">and formula_id = #{formulaId}</if>
|
||||
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFormulaListByCode" parameterType="Long" resultMap="SgFormulaListResult">
|
||||
<include refid="selectSgFormulaListVo"/>
|
||||
where code = #{code}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFormulaList" parameterType="SgFormulaList">
|
||||
insert into sg_formula_list
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">code,</if>
|
||||
<if test="formulaId != null">formula_id,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="ratio != null">ratio,</if>
|
||||
<if test="isGranular != null">is_granular,</if>
|
||||
<if test="isSupplement != null">is_supplement,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="formulaId != null">#{formulaId},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="ratio != null">#{ratio},</if>
|
||||
<if test="isGranular != null">#{isGranular},</if>
|
||||
<if test="isSupplement != null">#{isSupplement},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFormulaList" parameterType="SgFormulaList">
|
||||
update sg_formula_list
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="formulaId != null">formula_id = #{formulaId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="ratio != null">ratio = #{ratio},</if>
|
||||
<if test="isGranular != null">is_granular = #{isGranular},</if>
|
||||
<if test="isSupplement != null">is_supplement = #{isSupplement},</if>
|
||||
</trim>
|
||||
where code = #{code}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFormulaListByCode" parameterType="Long">
|
||||
delete from sg_formula_list where code = #{code}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFormulaListByCodes" parameterType="String">
|
||||
delete from sg_formula_list where code in
|
||||
<foreach item="code" collection="array" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFormulaListByFormulaIdAndBatchId" parameterType="SgFormulaList">
|
||||
DELETE FROM sg_formula_list WHERE formula_id = #{formulaId} AND batch_id = #{batchId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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.SgFormulaManagementMapper">
|
||||
|
||||
<resultMap type="SgFormulaManagement" id="SgFormulaManagementResult">
|
||||
<result property="formulaId" column="formula_id" />
|
||||
<result property="feedStage" column="feed_stage" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="useStartDate" column="use_start_date" />
|
||||
<result property="useEndDate" column="use_end_date" />
|
||||
<result property="useState" column="use_state" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgFormulaManagementVo">
|
||||
select formula_id, feed_stage, batch_id, use_start_date, use_end_date, use_state, remark from sg_formula_management
|
||||
</sql>
|
||||
|
||||
<select id="selectSgFormulaManagementList" parameterType="SgFormulaManagement" resultMap="SgFormulaManagementResult">
|
||||
<include refid="selectSgFormulaManagementVo"/>
|
||||
<where>
|
||||
<if test="formulaId != null and formulaId != ''"> and formula_id = #{formulaId}</if>
|
||||
<if test="feedStage != null and feedStage != ''"> and feed_stage = #{feedStage}</if>
|
||||
<if test="batchId != null and batchId != ''"> and batch_id = #{batchId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgFormulaManagementByFormulaId" parameterType="String" resultMap="SgFormulaManagementResult">
|
||||
<include refid="selectSgFormulaManagementVo"/>
|
||||
where formula_id = #{formulaId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgFormulaManagement" parameterType="SgFormulaManagement">
|
||||
insert into sg_formula_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="formulaId != null and formulaId != ''">formula_id,</if>
|
||||
<if test="feedStage != null and feedStage != ''">feed_stage,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="useStartDate != null">use_start_date,</if>
|
||||
<if test="useEndDate != null">use_end_date,</if>
|
||||
<if test="useState != null">use_state,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="formulaId != null and formulaId != ''">#{formulaId},</if>
|
||||
<if test="feedStage != null and feedStage != ''">#{feedStage},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="useStartDate != null">#{useStartDate},</if>
|
||||
<if test="useEndDate != null">#{useEndDate},</if>
|
||||
<if test="useState != null">#{useState},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgFormulaManagement" parameterType="SgFormulaManagement">
|
||||
update sg_formula_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="feedStage != null and feedStage != ''">feed_stage = #{feedStage},</if>
|
||||
<if test="useStartDate != null">use_start_date = #{useStartDate},</if>
|
||||
<if test="useEndDate != null">use_end_date = #{useEndDate},</if>
|
||||
<if test="useState != null">use_state = #{useState},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where formula_id = #{formulaId} AND batch_id = #{batchId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgFormulaManagementByFormulaId" parameterType="String">
|
||||
delete from sg_formula_management where formula_id = #{formulaId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgFormulaManagementByFormulaIds" parameterType="String">
|
||||
delete from sg_formula_management where formula_id in
|
||||
<foreach item="formulaId" collection="array" open="(" separator="," close=")">
|
||||
#{formulaId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteSgFormulaManagement" parameterType="SgFormulaManagement">
|
||||
delete from sg_formula_management where formula_id = #{formulaId} and batch_id = #{batchId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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.SgMaterialMapper">
|
||||
|
||||
<resultMap type="SgMaterial" id="SgMaterialResult">
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="isGranular" column="is_granular" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSgMaterialVo">
|
||||
select material_id, material_name, is_granular from sg_material
|
||||
</sql>
|
||||
|
||||
<select id="selectSgMaterialList" parameterType="SgMaterial" resultMap="SgMaterialResult">
|
||||
<include refid="selectSgMaterialVo"/>
|
||||
<where>
|
||||
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="isGranular != null "> and is_granular = #{isGranular}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSgMaterialByMaterialId" parameterType="String" resultMap="SgMaterialResult">
|
||||
<include refid="selectSgMaterialVo"/>
|
||||
where material_id = #{materialId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSgMaterial" parameterType="SgMaterial">
|
||||
insert into sg_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null and materialName != ''">material_name,</if>
|
||||
<if test="isGranular != null">is_granular,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
||||
<if test="isGranular != null">#{isGranular},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSgMaterial" parameterType="SgMaterial">
|
||||
update sg_material
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
||||
<if test="isGranular != null">is_granular = #{isGranular},</if>
|
||||
</trim>
|
||||
where material_id = #{materialId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSgMaterialByMaterialId" parameterType="String">
|
||||
delete from sg_material where material_id = #{materialId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSgMaterialByMaterialIds" parameterType="String">
|
||||
delete from sg_material where material_id in
|
||||
<foreach item="materialId" collection="array" open="(" separator="," close=")">
|
||||
#{materialId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?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.produce.breed.mapper.ScSheepDeathMapper">
|
||||
|
||||
<resultMap type="ScSheepDeath" id="ScSheepDeathResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="manageTags" column="manage_tags" />
|
||||
<result property="eventType" column="event_type" />
|
||||
<result property="deathDate" column="death_date" />
|
||||
<result property="diseaseTypeId" column="disease_type_id" />
|
||||
<result property="diseaseSubtypeId" column="disease_subtype_id" />
|
||||
<result property="disposalDirection" column="disposal_direction" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="handler" column="handler" />
|
||||
<result property="workGroup" column="work_group" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScSheepDeathVo">
|
||||
select id, sheep_id, manage_tags, event_type, death_date, disease_type_id, disease_subtype_id, disposal_direction, technician, handler, work_group, create_by, create_time, comment, update_by, update_time, is_delete from sc_sheep_death
|
||||
</sql>
|
||||
|
||||
<select id="selectScSheepDeathList" parameterType="ScSheepDeath" resultMap="ScSheepDeathResult">
|
||||
<include refid="selectScSheepDeathVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="manageTags != null and manageTags != ''"> and manage_tags = #{manageTags}</if>
|
||||
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if>
|
||||
<if test="deathDate != null "> and death_date = #{deathDate}</if>
|
||||
<if test="diseaseTypeId != null "> and disease_type_id = #{diseaseTypeId}</if>
|
||||
<if test="diseaseSubtypeId != null "> and disease_subtype_id = #{diseaseSubtypeId}</if>
|
||||
<if test="disposalDirection != null and disposalDirection != ''"> and disposal_direction = #{disposalDirection}</if>
|
||||
<if test="technician != null and technician != ''"> and technician = #{technician}</if>
|
||||
<if test="handler != null and handler != ''"> and handler = #{handler}</if>
|
||||
<if test="workGroup != null and workGroup != ''"> and work_group = #{workGroup}</if>
|
||||
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScSheepDeathById" parameterType="Long" resultMap="ScSheepDeathResult">
|
||||
<include refid="selectScSheepDeathVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 根据管理耳号查询sheep_file视图信息 -->
|
||||
<select id="selectSheepFileByManageTags" parameterType="String" resultType="java.util.Map">
|
||||
select id as sheepId, variety, name as sheepType, gender, day_age as dayAge, parity, sheepfold_name as sheepfoldName, breed as breedStatus, post_lambing_day as postLambingDay, lactation_day as lactationDay, gestation_day as gestationDay
|
||||
from sheep_file
|
||||
where bs_manage_tags = #{manageTags} and is_delete = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertScSheepDeath" parameterType="ScSheepDeath" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_sheep_death
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="manageTags != null and manageTags != ''">manage_tags,</if>
|
||||
<if test="eventType != null">event_type,</if>
|
||||
<if test="deathDate != null">death_date,</if>
|
||||
<if test="diseaseTypeId != null">disease_type_id,</if>
|
||||
<if test="diseaseSubtypeId != null">disease_subtype_id,</if>
|
||||
<if test="disposalDirection != null">disposal_direction,</if>
|
||||
<if test="technician != null">technician,</if>
|
||||
<if test="handler != null">handler,</if>
|
||||
<if test="workGroup != null">work_group,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="manageTags != null and manageTags != ''">#{manageTags},</if>
|
||||
<if test="eventType != null">#{eventType},</if>
|
||||
<if test="deathDate != null">#{deathDate},</if>
|
||||
<if test="diseaseTypeId != null">#{diseaseTypeId},</if>
|
||||
<if test="diseaseSubtypeId != null">#{diseaseSubtypeId},</if>
|
||||
<if test="disposalDirection != null">#{disposalDirection},</if>
|
||||
<if test="technician != null">#{technician},</if>
|
||||
<if test="handler != null">#{handler},</if>
|
||||
<if test="workGroup != null">#{workGroup},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScSheepDeath" parameterType="ScSheepDeath">
|
||||
update sc_sheep_death
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="manageTags != null and manageTags != ''">manage_tags = #{manageTags},</if>
|
||||
<if test="eventType != null">event_type = #{eventType},</if>
|
||||
<if test="deathDate != null">death_date = #{deathDate},</if>
|
||||
<if test="diseaseTypeId != null">disease_type_id = #{diseaseTypeId},</if>
|
||||
<if test="diseaseSubtypeId != null">disease_subtype_id = #{diseaseSubtypeId},</if>
|
||||
<if test="disposalDirection != null">disposal_direction = #{disposalDirection},</if>
|
||||
<if test="technician != null">technician = #{technician},</if>
|
||||
<if test="handler != null">handler = #{handler},</if>
|
||||
<if test="workGroup != null">work_group = #{workGroup},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScSheepDeathById" parameterType="Long">
|
||||
delete from sc_sheep_death where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScSheepDeathByIds" parameterType="String">
|
||||
delete from sc_sheep_death where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?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.stock.mapper.WzMaterialsManagementMapper">
|
||||
|
||||
<resultMap type="WzMaterialsManagement" id="WzMaterialsManagementResult">
|
||||
<result property="materialManagementCode" column="material_management_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="currentStock" column="current_stock" />
|
||||
<result property="stockAlarm" column="stock_alarm" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="expirationDate" column="expiration_date" />
|
||||
<result property="expirationAlarm" column="expiration_alarm" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzMaterialsManagementVo">
|
||||
select material_management_code, material_id, material_name, batch_id, material_specification, material_unit, current_stock, stock_alarm, production_date, expiration_date, expiration_alarm from wz_materials_management
|
||||
</sql>
|
||||
|
||||
<select id="selectWzMaterialsManagementList" parameterType="WzMaterialsManagement" resultMap="WzMaterialsManagementResult">
|
||||
<include refid="selectWzMaterialsManagementVo"/>
|
||||
<where>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="params.beginProductionDate != null and params.beginProductionDate != '' and params.endProductionDate != null and params.endProductionDate != ''"> and production_date between #{params.beginProductionDate} and #{params.endProductionDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzMaterialsManagementByMaterialManagementCode" parameterType="Long" resultMap="WzMaterialsManagementResult">
|
||||
<include refid="selectWzMaterialsManagementVo"/>
|
||||
where material_management_code = #{materialManagementCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzMaterialsManagement" parameterType="WzMaterialsManagement" useGeneratedKeys="true" keyProperty="materialManagementCode">
|
||||
insert into wz_materials_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">material_id,</if>
|
||||
<if test="materialName != null and materialName != ''">material_name,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="currentStock != null">current_stock,</if>
|
||||
<if test="stockAlarm != null">stock_alarm,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="expirationDate != null">expiration_date,</if>
|
||||
<if test="expirationAlarm != null">expiration_alarm,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">#{materialId},</if>
|
||||
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="currentStock != null">#{currentStock},</if>
|
||||
<if test="stockAlarm != null">#{stockAlarm},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="expirationDate != null">#{expirationDate},</if>
|
||||
<if test="expirationAlarm != null">#{expirationAlarm},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzMaterialsManagement" parameterType="WzMaterialsManagement">
|
||||
update wz_materials_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="materialId != null and materialId != ''">material_id = #{materialId},</if>
|
||||
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
||||
<if test="batchId != null">batch_id = #{batchId},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="currentStock != null">current_stock = #{currentStock},</if>
|
||||
<if test="stockAlarm != null">stock_alarm = #{stockAlarm},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
|
||||
<if test="expirationAlarm != null">expiration_alarm = #{expirationAlarm},</if>
|
||||
</trim>
|
||||
where material_id = #{materialId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzMaterialsManagementByMaterialManagementCode" parameterType="Long">
|
||||
delete from wz_materials_management where material_management_code = #{materialManagementCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzMaterialsManagementByMaterialManagementCodes" parameterType="String">
|
||||
delete from wz_materials_management where material_management_code in
|
||||
<foreach item="materialManagementCode" collection="array" open="(" separator="," close=")">
|
||||
#{materialManagementCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectWzMaterialsManagementByMaterialID" parameterType="String" resultMap="WzMaterialsManagementResult">
|
||||
SELECT * FROM wz_materials_management WHERE material_id = #{materialID}
|
||||
</select>
|
||||
</mapper>
|
||||
147
zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml
Normal file
147
zhyc-module/src/main/resources/mapper/stock/WzStockInMapper.xml
Normal file
@@ -0,0 +1,147 @@
|
||||
<?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.stock.mapper.WzStockInMapper">
|
||||
|
||||
<resultMap type="WzStockIn" id="WzStockInResult">
|
||||
<result property="stockInCode" column="stock_in_code" />
|
||||
<result property="docDate" column="doc_date" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="docId" column="doc_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="repositoryId" column="repository_id" />
|
||||
<result property="repositoryName" column="repository_name" />
|
||||
<result property="stockInType" column="stock_in_type" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="departmentId" column="department_id" />
|
||||
<result property="departmentName" column="department_name" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operatorName" column="operator_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="single" column="single" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="count" column="count" />
|
||||
<result property="stockInAdjustRemark" column="stock_in_adjust_remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzStockInVo">
|
||||
select stock_in_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, stock_in_type, supplier_id, supplier_name, department_id, department_name, operator_id, operator_name, remark, single, reviewer, material_id, material_name, material_specification, material_unit, count, stock_in_adjust_remark from wz_stock_in
|
||||
</sql>
|
||||
|
||||
<select id="selectWzStockInList" parameterType="WzStockIn" resultMap="WzStockInResult">
|
||||
<include refid="selectWzStockInVo"/>
|
||||
<where>
|
||||
<if test="params.beginDocDate != null and params.beginDocDate != '' and params.endDocDate != null and params.endDocDate != ''"> and doc_date between #{params.beginDocDate} and #{params.endDocDate}</if>
|
||||
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
||||
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzStockInByStockInCode" parameterType="Long" resultMap="WzStockInResult">
|
||||
<include refid="selectWzStockInVo"/>
|
||||
where stock_in_code = #{stockInCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzStockIn" parameterType="WzStockIn" useGeneratedKeys="true" keyProperty="stockInCode">
|
||||
insert into wz_stock_in
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="docId != null">doc_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="repositoryId != null">repository_id,</if>
|
||||
<if test="repositoryName != null">repository_name,</if>
|
||||
<if test="stockInType != null">stock_in_type,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="supplierName != null">supplier_name,</if>
|
||||
<if test="departmentId != null">department_id,</if>
|
||||
<if test="departmentName != null">department_name,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorName != null">operator_name,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="single != null">single,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="count != null">count,</if>
|
||||
<if test="stockInAdjustRemark != null">stock_in_adjust_remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">#{docDate},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="docId != null">#{docId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="repositoryId != null">#{repositoryId},</if>
|
||||
<if test="repositoryName != null">#{repositoryName},</if>
|
||||
<if test="stockInType != null">#{stockInType},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
<if test="supplierName != null">#{supplierName},</if>
|
||||
<if test="departmentId != null">#{departmentId},</if>
|
||||
<if test="departmentName != null">#{departmentName},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorName != null">#{operatorName},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="single != null">#{single},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="count != null">#{count},</if>
|
||||
<if test="stockInAdjustRemark != null">#{stockInAdjustRemark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzStockIn" parameterType="WzStockIn">
|
||||
update wz_stock_in
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date = #{docDate},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="docId != null">doc_id = #{docId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
|
||||
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
|
||||
<if test="stockInType != null">stock_in_type = #{stockInType},</if>
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
||||
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||
<if test="departmentName != null">department_name = #{departmentName},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorName != null">operator_name = #{operatorName},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="single != null">single = #{single},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="count != null">count = #{count},</if>
|
||||
<if test="stockInAdjustRemark != null">stock_in_adjust_remark = #{stockInAdjustRemark},</if>
|
||||
</trim>
|
||||
where stock_in_code = #{stockInCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzStockInByStockInCode" parameterType="Long">
|
||||
delete from wz_stock_in where stock_in_code = #{stockInCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzStockInByStockInCodes" parameterType="String">
|
||||
delete from wz_stock_in where stock_in_code in
|
||||
<foreach item="stockInCode" collection="array" open="(" separator="," close=")">
|
||||
#{stockInCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getEarliestStockIn" resultMap="WzStockInResult">
|
||||
SELECT * FROM wz_stock_in ORDER BY doc_date DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
180
zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml
Normal file
180
zhyc-module/src/main/resources/mapper/stock/WzStockOutMapper.xml
Normal file
@@ -0,0 +1,180 @@
|
||||
<?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.stock.mapper.WzStockOutMapper">
|
||||
|
||||
<resultMap type="WzStockOut" id="WzStockOutResult">
|
||||
<result property="stockOutCode" column="stock_out_code" />
|
||||
<result property="docDate" column="doc_date" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="docId" column="doc_id" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="repositoryId" column="repository_id" />
|
||||
<result property="repositoryName" column="repository_name" />
|
||||
<result property="projectClassification" column="project_classification" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="departmentId" column="department_id" />
|
||||
<result property="departmentName" column="department_name" />
|
||||
<result property="receiverId" column="receiver_id" />
|
||||
<result property="receiver" column="receiver" />
|
||||
<result property="single" column="single" />
|
||||
<result property="reviewer" column="reviewer" />
|
||||
<result property="reviewDate" column="review_date" />
|
||||
<result property="modifier" column="modifier" />
|
||||
<result property="materialClassId" column="material_class_id" />
|
||||
<result property="materialClassName" column="material_class_name" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpecification" column="material_specification" />
|
||||
<result property="materialUnit" column="material_unit" />
|
||||
<result property="count" column="count" />
|
||||
<result property="batchId" column="batch_id" />
|
||||
<result property="productionDate" column="production_date" />
|
||||
<result property="shelfLife" column="shelf_life" />
|
||||
<result property="shelfLifeUnit" column="shelf_life_unit" />
|
||||
<result property="expirationDate" column="expiration_date" />
|
||||
<result property="agent" column="agent" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWzStockOutVo">
|
||||
select stock_out_code, doc_date, create_date, doc_id, business_type, repository_id, repository_name, project_classification, project_id, project_name, department_id, department_name,receiver_id, receiver, single, reviewer, review_date, modifier, material_class_id, material_class_name, material_id,material_name, material_specification, material_unit, count, batch_id, production_date, shelf_life, shelf_life_unit, expiration_date, agent from wz_stock_out
|
||||
</sql>
|
||||
|
||||
<select id="selectWzStockOutList" parameterType="WzStockOut" resultMap="WzStockOutResult">
|
||||
<include refid="selectWzStockOutVo"/>
|
||||
<where>
|
||||
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
|
||||
<if test="repositoryName != null and repositoryName != ''"> and repository_name like concat('%', #{repositoryName}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="departmentName != null and departmentName != ''"> and department_name like concat('%', #{departmentName}, '%')</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWzStockOutByStockOutCode" parameterType="Long" resultMap="WzStockOutResult">
|
||||
<include refid="selectWzStockOutVo"/>
|
||||
where stock_out_code = #{stockOutCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWzStockOut" parameterType="WzStockOut" useGeneratedKeys="true" keyProperty="stockOutCode">
|
||||
insert into wz_stock_out
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="docId != null">doc_id,</if>
|
||||
<if test="businessType != null">business_type,</if>
|
||||
<if test="repositoryId != null">repository_id,</if>
|
||||
<if test="repositoryName != null">repository_name,</if>
|
||||
<if test="projectClassification != null">project_classification,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="projectName != null">project_name,</if>
|
||||
<if test="departmentId != null">department_id,</if>
|
||||
<if test="departmentName != null">department_name,</if>
|
||||
<if test="receiverId != null">receiver_id,</if>
|
||||
<if test="receiver != null">receiver,</if>
|
||||
<if test="single != null">single,</if>
|
||||
<if test="reviewer != null">reviewer,</if>
|
||||
<if test="reviewDate != null">review_date,</if>
|
||||
<if test="modifier != null">modifier,</if>
|
||||
<if test="materialClassId != null">material_class_id,</if>
|
||||
<if test="materialClassName != null">material_class_name,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpecification != null">material_specification,</if>
|
||||
<if test="materialUnit != null">material_unit,</if>
|
||||
<if test="count != null">count,</if>
|
||||
<if test="batchId != null">batch_id,</if>
|
||||
<if test="productionDate != null">production_date,</if>
|
||||
<if test="shelfLife != null">shelf_life,</if>
|
||||
<if test="shelfLifeUnit != null">shelf_life_unit,</if>
|
||||
<if test="expirationDate != null">expiration_date,</if>
|
||||
<if test="agent != null">agent,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="docDate != null">#{docDate},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="docId != null">#{docId},</if>
|
||||
<if test="businessType != null">#{businessType},</if>
|
||||
<if test="repositoryId != null">#{repositoryId},</if>
|
||||
<if test="repositoryName != null">#{repositoryName},</if>
|
||||
<if test="projectClassification != null">#{projectClassification},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null">#{projectName},</if>
|
||||
<if test="departmentId != null">#{departmentId},</if>
|
||||
<if test="departmentName != null">#{departmentName},</if>
|
||||
<if test="receiverId != null">#{receiverId},</if>
|
||||
<if test="receiver != null">#{receiver},</if>
|
||||
<if test="single != null">#{single},</if>
|
||||
<if test="reviewer != null">#{reviewer},</if>
|
||||
<if test="reviewDate != null">#{reviewDate},</if>
|
||||
<if test="modifier != null">#{modifier},</if>
|
||||
<if test="materialClassId != null">#{materialClassId},</if>
|
||||
<if test="materialClassName != null">#{materialClassName},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpecification != null">#{materialSpecification},</if>
|
||||
<if test="materialUnit != null">#{materialUnit},</if>
|
||||
<if test="count != null">#{count},</if>
|
||||
<if test="batchId != null">#{batchId},</if>
|
||||
<if test="productionDate != null">#{productionDate},</if>
|
||||
<if test="shelfLife != null">#{shelfLife},</if>
|
||||
<if test="shelfLifeUnit != null">#{shelfLifeUnit},</if>
|
||||
<if test="expirationDate != null">#{expirationDate},</if>
|
||||
<if test="agent != null">#{agent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWzStockOut" parameterType="WzStockOut">
|
||||
update wz_stock_out
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="docDate != null">doc_date = #{docDate},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="docId != null">doc_id = #{docId},</if>
|
||||
<if test="businessType != null">business_type = #{businessType},</if>
|
||||
<if test="repositoryId != null">repository_id = #{repositoryId},</if>
|
||||
<if test="repositoryName != null">repository_name = #{repositoryName},</if>
|
||||
<if test="projectClassification != null">project_classification = #{projectClassification},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="projectName != null">project_name = #{projectName},</if>
|
||||
<if test="departmentId != null">department_id = #{departmentId},</if>
|
||||
<if test="departmentName != null">department_name = #{departmentName},</if>
|
||||
<if test="receiverId != null">receiver_id = #{receiverId},</if>
|
||||
<if test="receiver != null">receiver = #{receiver},</if>
|
||||
<if test="single != null">single = #{single},</if>
|
||||
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||
<if test="reviewDate != null">review_date = #{reviewDate},</if>
|
||||
<if test="modifier != null">modifier = #{modifier},</if>
|
||||
<if test="materialClassId != null">material_class_id = #{materialClassId},</if>
|
||||
<if test="materialClassName != null">material_class_name = #{materialClassName},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpecification != null">material_specification = #{materialSpecification},</if>
|
||||
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
|
||||
<if test="count != null">count = #{count},</if>
|
||||
<if test="batchId != null">batch_id = #{batchId},</if>
|
||||
<if test="productionDate != null">production_date = #{productionDate},</if>
|
||||
<if test="shelfLife != null">shelf_life = #{shelfLife},</if>
|
||||
<if test="shelfLifeUnit != null">shelf_life_unit = #{shelfLifeUnit},</if>
|
||||
<if test="expirationDate != null">expiration_date = #{expirationDate},</if>
|
||||
<if test="agent != null">agent = #{agent},</if>
|
||||
</trim>
|
||||
where stock_out_code = #{stockOutCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWzStockOutByStockOutCode" parameterType="Long">
|
||||
delete from wz_stock_out where stock_out_code = #{stockOutCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWzStockOutByStockOutCodes" parameterType="String">
|
||||
delete from wz_stock_out where stock_out_code in
|
||||
<foreach item="stockOutCode" collection="array" open="(" separator="," close=")">
|
||||
#{stockOutCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getEarliestStockOut" resultMap="WzStockOutResult">
|
||||
SELECT * FROM wz_stock_out ORDER BY create_date DESC LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user