需求修改
This commit is contained in:
207
zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml
Normal file
207
zhyc-module/src/main/resources/mapper/sale/SxSheepSaleMapper.xml
Normal file
@@ -0,0 +1,207 @@
|
||||
<?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.sale.mapper.SxSheepSaleMapper">
|
||||
|
||||
<resultMap type="SxSheepSale" id="SxSheepSaleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="bsManageTags" column="bs_manage_tags" />
|
||||
<result property="sheepfoldId" column="sheepfold_id" />
|
||||
<result property="variety" column="variety" />
|
||||
<result property="sheepName" column="sheep_name" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="monthAge" column="month_age" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="breed" column="breed" />
|
||||
<result property="postLambingDay" column="post_lambing_day" />
|
||||
<result property="lactationDay" column="lactation_day" />
|
||||
<result property="lambingDay" column="lambing_day" />
|
||||
<result property="eventType" column="event_type" />
|
||||
<result property="saleDate" column="sale_date" />
|
||||
<result property="pricingMethod" column="pricing_method" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="totalPrice" column="total_price" />
|
||||
<result property="totalWeight" column="total_weight" />
|
||||
<result property="avgWeight" column="avg_weight" />
|
||||
<result property="avgPricePerSheep" column="avg_price_per_sheep" />
|
||||
<result property="saleType" column="sale_type" />
|
||||
<result property="diseaseType" column="disease_type" />
|
||||
<result property="secondaryReason" column="secondary_reason" />
|
||||
<result property="groupCode" column="group_code" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="salesPersonId" column="sales_person_id" />
|
||||
<result property="quarantineNo" column="quarantine_no" />
|
||||
<result property="approvalNo" column="approval_no" />
|
||||
<result property="technicianId" column="technician_id" />
|
||||
<result property="handlerId" column="handler_id" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSxSheepSaleVo">
|
||||
select id, bs_manage_tags, sheepfold_id, variety, sheep_name, gender, month_age, parity, breed, post_lambing_day, lactation_day, lambing_day, event_type, sale_date, pricing_method, unit_price, total_price, total_weight, avg_weight, avg_price_per_sheep, sale_type, disease_type, secondary_reason, group_code, customer_id, sales_person_id, quarantine_no, approval_no, technician_id, handler_id, created_by, created_at, remark from sx_sheep_sale
|
||||
</sql>
|
||||
|
||||
<!-- 【新增】根据耳号查询羊只信息的SQL片段 -->
|
||||
<sql id="selectSheepFileVo">
|
||||
select
|
||||
bs_manage_tags,
|
||||
variety,
|
||||
name as sheep_name,
|
||||
gender,
|
||||
month_age,
|
||||
parity,
|
||||
breed,
|
||||
post_lambing_day,
|
||||
lactation_day,
|
||||
lambing_day,
|
||||
sheepfold_id
|
||||
from sheep_file
|
||||
</sql>
|
||||
|
||||
<!-- 【新增】根据耳号查询羊只信息 -->
|
||||
<select id="selectSheepInfoByTag" parameterType="String" resultMap="SxSheepSaleResult">
|
||||
<include refid="selectSheepFileVo"/>
|
||||
where bs_manage_tags = #{bsManageTags}
|
||||
</select>
|
||||
|
||||
<select id="selectSxSheepSaleList" parameterType="SxSheepSale" resultMap="SxSheepSaleResult">
|
||||
<include refid="selectSxSheepSaleVo"/>
|
||||
<where>
|
||||
<if test="bsManageTags != null and bsManageTags != ''"> and bs_manage_tags = #{bsManageTags}</if>
|
||||
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="variety != null and variety != ''"> and variety = #{variety}</if>
|
||||
<if test="sheepName != null and sheepName != ''"> and sheep_name = #{sheepName}</if>
|
||||
<if test="saleDate != null"> and sale_date = #{saleDate}</if>
|
||||
<if test="saleType != null and saleType != ''"> and sale_type = #{saleType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSxSheepSaleById" parameterType="Long" resultMap="SxSheepSaleResult">
|
||||
<include refid="selectSxSheepSaleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSxSheepSale" parameterType="SxSheepSale" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sx_sheep_sale
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bsManageTags != null and bsManageTags != ''">bs_manage_tags,</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id,</if>
|
||||
<if test="variety != null and variety != ''">variety,</if>
|
||||
<if test="sheepName != null and sheepName != ''">sheep_name,</if>
|
||||
<if test="gender != null and gender != ''">gender,</if>
|
||||
<if test="monthAge != null">month_age,</if>
|
||||
<if test="parity != null">parity,</if>
|
||||
<if test="breed != null and breed != ''">breed,</if>
|
||||
<if test="postLambingDay != null">post_lambing_day,</if>
|
||||
<if test="lactationDay != null">lactation_day,</if>
|
||||
<if test="lambingDay != null">lambing_day,</if>
|
||||
<if test="eventType != null and eventType != ''">event_type,</if>
|
||||
<if test="saleDate != null">sale_date,</if>
|
||||
<if test="pricingMethod != null and pricingMethod != ''">pricing_method,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="totalPrice != null">total_price,</if>
|
||||
<if test="totalWeight != null">total_weight,</if>
|
||||
<if test="avgWeight != null">avg_weight,</if>
|
||||
<if test="avgPricePerSheep != null">avg_price_per_sheep,</if>
|
||||
<if test="saleType != null and saleType != ''">sale_type,</if>
|
||||
<if test="diseaseType != null and diseaseType != ''">disease_type,</if>
|
||||
<if test="secondaryReason != null and secondaryReason != ''">secondary_reason,</if>
|
||||
<if test="groupCode != null and groupCode != ''">group_code,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="salesPersonId != null">sales_person_id,</if>
|
||||
<if test="quarantineNo != null and quarantineNo != ''">quarantine_no,</if>
|
||||
<if test="approvalNo != null and approvalNo != ''">approval_no,</if>
|
||||
<if test="technicianId != null">technician_id,</if>
|
||||
<if test="handlerId != null">handler_id,</if>
|
||||
<if test="createdBy != null">created_by,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bsManageTags != null and bsManageTags != ''">#{bsManageTags},</if>
|
||||
<if test="sheepfoldId != null">#{sheepfoldId},</if>
|
||||
<if test="variety != null and variety != ''">#{variety},</if>
|
||||
<if test="sheepName != null and sheepName != ''">#{sheepName},</if>
|
||||
<if test="gender != null and gender != ''">#{gender},</if>
|
||||
<if test="monthAge != null">#{monthAge},</if>
|
||||
<if test="parity != null">#{parity},</if>
|
||||
<if test="breed != null and breed != ''">#{breed},</if>
|
||||
<if test="postLambingDay != null">#{postLambingDay},</if>
|
||||
<if test="lactationDay != null">#{lactationDay},</if>
|
||||
<if test="lambingDay != null">#{lambingDay},</if>
|
||||
<if test="eventType != null and eventType != ''">#{eventType},</if>
|
||||
<if test="saleDate != null">#{saleDate},</if>
|
||||
<if test="pricingMethod != null and pricingMethod != ''">#{pricingMethod},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="totalPrice != null">#{totalPrice},</if>
|
||||
<if test="totalWeight != null">#{totalWeight},</if>
|
||||
<if test="avgWeight != null">#{avgWeight},</if>
|
||||
<if test="avgPricePerSheep != null">#{avgPricePerSheep},</if>
|
||||
<if test="saleType != null and saleType != ''">#{saleType},</if>
|
||||
<if test="diseaseType != null and diseaseType != ''">#{diseaseType},</if>
|
||||
<if test="secondaryReason != null and secondaryReason != ''">#{secondaryReason},</if>
|
||||
<if test="groupCode != null and groupCode != ''">#{groupCode},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="salesPersonId != null">#{salesPersonId},</if>
|
||||
<if test="quarantineNo != null and quarantineNo != ''">#{quarantineNo},</if>
|
||||
<if test="approvalNo != null and approvalNo != ''">#{approvalNo},</if>
|
||||
<if test="technicianId != null">#{technicianId},</if>
|
||||
<if test="handlerId != null">#{handlerId},</if>
|
||||
<if test="createdBy != null">#{createdBy},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSxSheepSale" parameterType="SxSheepSale">
|
||||
update sx_sheep_sale
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bsManageTags != null and bsManageTags != ''">bs_manage_tags = #{bsManageTags},</if>
|
||||
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
|
||||
<if test="variety != null and variety != ''">variety = #{variety},</if>
|
||||
<if test="sheepName != null and sheepName != ''">sheep_name = #{sheepName},</if>
|
||||
<if test="gender != null and gender != ''">gender = #{gender},</if>
|
||||
<if test="monthAge != null">month_age = #{monthAge},</if>
|
||||
<if test="parity != null">parity = #{parity},</if>
|
||||
<if test="breed != null and breed != ''">breed = #{breed},</if>
|
||||
<if test="postLambingDay != null">post_lambing_day = #{postLambingDay},</if>
|
||||
<if test="lactationDay != null">lactation_day = #{lactationDay},</if>
|
||||
<if test="lambingDay != null">lambing_day = #{lambingDay},</if>
|
||||
<if test="eventType != null and eventType != ''">event_type = #{eventType},</if>
|
||||
<if test="saleDate != null">sale_date = #{saleDate},</if>
|
||||
<if test="pricingMethod != null and pricingMethod != ''">pricing_method = #{pricingMethod},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
|
||||
<if test="avgWeight != null">avg_weight = #{avgWeight},</if>
|
||||
<if test="avgPricePerSheep != null">avg_price_per_sheep = #{avgPricePerSheep},</if>
|
||||
<if test="saleType != null and saleType != ''">sale_type = #{saleType},</if>
|
||||
<if test="diseaseType != null and diseaseType != ''">disease_type = #{diseaseType},</if>
|
||||
<if test="secondaryReason != null and secondaryReason != ''">secondary_reason = #{secondaryReason},</if>
|
||||
<if test="groupCode != null and groupCode != ''">group_code = #{groupCode},</if>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="salesPersonId != null">sales_person_id = #{salesPersonId},</if>
|
||||
<if test="quarantineNo != null and quarantineNo != ''">quarantine_no = #{quarantineNo},</if>
|
||||
<if test="approvalNo != null and approvalNo != ''">approval_no = #{approvalNo},</if>
|
||||
<if test="technicianId != null">technician_id = #{technicianId},</if>
|
||||
<if test="handlerId != null">handler_id = #{handlerId},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSxSheepSaleById" parameterType="Long">
|
||||
delete from sx_sheep_sale where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSxSheepSaleByIds" parameterType="String">
|
||||
delete from sx_sheep_sale where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user