Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?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.biosafety.mapper.SwMedicTypeMapper">
|
||||
|
||||
<resultMap type="SwMedicType" id="SwMedicTypeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwMedicTypeVo">
|
||||
select id, name from sw_medic_type
|
||||
</sql>
|
||||
|
||||
<select id="selectSwMedicTypeList" parameterType="SwMedicType" resultMap="SwMedicTypeResult">
|
||||
<include refid="selectSwMedicTypeVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwMedicTypeById" parameterType="Long" resultMap="SwMedicTypeResult">
|
||||
<include refid="selectSwMedicTypeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwMedicType" parameterType="SwMedicType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_medic_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwMedicType" parameterType="SwMedicType">
|
||||
update sw_medic_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwMedicTypeById" parameterType="Long">
|
||||
delete from sw_medic_type where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwMedicTypeByIds" parameterType="String">
|
||||
delete from sw_medic_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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.biosafety.mapper.SwMedicineMapper">
|
||||
|
||||
<resultMap type="SwMedicine" id="SwMedicineResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="medica" column="medica" />
|
||||
<result property="name" column="name" />
|
||||
<result property="medicType" column="medic_type" />
|
||||
<result property="usageId" column="usage_id" />
|
||||
<result property="comment" column="comment" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwMedicineVo">
|
||||
select id, medica, name, medic_type, usage_id, comment from sw_medicine
|
||||
</sql>
|
||||
|
||||
<select id="selectSwMedicineList" parameterType="SwMedicine" resultMap="SwMedicineResult">
|
||||
<include refid="selectSwMedicineVo"/>
|
||||
<where>
|
||||
<if test="medica != null and medica != ''"> and medica = #{medica}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="medicType != null "> and medic_type = #{medicType}</if>
|
||||
<if test="usageId != null "> and usage_id = #{usageId}</if>
|
||||
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwMedicineById" parameterType="Long" resultMap="SwMedicineResult">
|
||||
<include refid="selectSwMedicineVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwMedicine" parameterType="SwMedicine" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_medicine
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="medica != null">medica,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="medicType != null">medic_type,</if>
|
||||
<if test="usageId != null">usage_id,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="medica != null">#{medica},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="medicType != null">#{medicType},</if>
|
||||
<if test="usageId != null">#{usageId},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwMedicine" parameterType="SwMedicine">
|
||||
update sw_medicine
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="medica != null">medica = #{medica},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="medicType != null">medic_type = #{medicType},</if>
|
||||
<if test="usageId != null">usage_id = #{usageId},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwMedicineById" parameterType="Long">
|
||||
delete from sw_medicine where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwMedicineByIds" parameterType="String">
|
||||
delete from sw_medicine where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,121 @@
|
||||
<?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.biosafety.mapper.SwMedicineUsageMapper">
|
||||
|
||||
<resultMap type="SwMedicineUsage" id="SwMedicineUsageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="useType" column="use_type" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SwMedicineUsageSwMedicineUsageDetailsResult" type="SwMedicineUsage" extends="SwMedicineUsageResult">
|
||||
<collection property="swMedicineUsageDetailsList" ofType="SwMedicineUsageDetails" column="id" select="selectSwMedicineUsageDetailsList" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="SwMedicineUsageDetails" id="SwMedicineUsageDetailsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mediUsage" column="medi_usage" />
|
||||
<result property="mediId" column="medi_id" />
|
||||
<result property="mediName" column="name"/>
|
||||
<result property="dosage" column="dosage" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="usageId" column="usageId" />
|
||||
<result property="manufacturer" column="manufacturer" />
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwMedicineUsageVo">
|
||||
select id, name, use_type, update_by, update_time, create_by, create_time from sw_medicine_usage
|
||||
</sql>
|
||||
|
||||
<select id="selectSwMedicineUsageList" parameterType="SwMedicineUsage" resultMap="SwMedicineUsageResult">
|
||||
<include refid="selectSwMedicineUsageVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="useType != null and useType != ''"> and use_type = #{useType}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwMedicineUsageById" parameterType="Long" resultMap="SwMedicineUsageSwMedicineUsageDetailsResult">
|
||||
select id, name, use_type, update_by, update_time, create_by, create_time
|
||||
from sw_medicine_usage
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSwMedicineUsageDetailsList" resultMap="SwMedicineUsageDetailsResult">
|
||||
select smud.id, medi_usage, medi_id, dosage, unit, usageId, manufacturer, batch_number,
|
||||
sm.name
|
||||
from sw_medicine_usage_details smud
|
||||
join sw_medicine sm on smud.medi_id = sm.id
|
||||
where medi_usage = #{medi_usage}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwMedicineUsage" parameterType="SwMedicineUsage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_medicine_usage
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="useType != null">use_type,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="useType != null">#{useType},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwMedicineUsage" parameterType="SwMedicineUsage">
|
||||
update sw_medicine_usage
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="useType != null">use_type = #{useType},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwMedicineUsageById" parameterType="Long">
|
||||
delete from sw_medicine_usage where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwMedicineUsageByIds" parameterType="String">
|
||||
delete from sw_medicine_usage where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwMedicineUsageDetailsByMediUsages" parameterType="String">
|
||||
delete from sw_medicine_usage_details where medi_usage in
|
||||
<foreach item="mediUsage" collection="array" open="(" separator="," close=")">
|
||||
#{mediUsage}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwMedicineUsageDetailsByMediUsage" parameterType="Long">
|
||||
delete from sw_medicine_usage_details where medi_usage = #{mediUsage}
|
||||
</delete>
|
||||
|
||||
<insert id="batchSwMedicineUsageDetails">
|
||||
insert into sw_medicine_usage_details( id, medi_usage, medi_id, dosage, unit, usageId, manufacturer, batch_number) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.mediUsage}, #{item.mediId}, #{item.dosage}, #{item.unit}, #{item.usageId}, #{item.manufacturer}, #{item.batchNumber})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -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.biosafety.mapper.SwPrescriptionMapper">
|
||||
|
||||
<resultMap type="SwPrescription" id="SwPrescriptionResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="no" column="no" />
|
||||
<result property="name" column="name" />
|
||||
<result property="persType" column="pers_type" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="status" column="status" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SwPrescriptionSwPresDetailResult" type="SwPrescription" extends="SwPrescriptionResult">
|
||||
<collection property="swPresDetailList" ofType="SwPresDetail" column="id" select="selectSwPresDetailList" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="SwPresDetail" id="SwPresDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="persId" column="pers_id" />
|
||||
<result property="mediId" column="medi_id" />
|
||||
<result property="dosage" column="dosage" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="usageId" column="usage_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwPrescriptionVo">
|
||||
select id, no, name, pers_type, comment, status, update_by, update_time, create_by, create_time from sw_prescription
|
||||
</sql>
|
||||
|
||||
<select id="selectSwPrescriptionList" parameterType="SwPrescription" resultMap="SwPrescriptionResult">
|
||||
<include refid="selectSwPrescriptionVo"/>
|
||||
<where>
|
||||
<if test="no != null and no != ''"> and no like concat('%', #{no}, '%')</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="persType != null "> and pers_type = #{persType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwPrescriptionById" parameterType="Long" resultMap="SwPrescriptionSwPresDetailResult">
|
||||
select id, no, name, pers_type, comment, status, update_by, update_time, create_by, create_time
|
||||
from sw_prescription
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectSwPresDetailList" resultMap="SwPresDetailResult">
|
||||
select id, pers_id, medi_id, dosage, unit_id, usage_id
|
||||
from sw_pres_detail
|
||||
where pers_id = #{pers_id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwPrescription" parameterType="SwPrescription" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_prescription
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="no != null">no,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="persType != null">pers_type,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="no != null">#{no},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="persType != null">#{persType},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwPrescription" parameterType="SwPrescription">
|
||||
update sw_prescription
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="no != null">no = #{no},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="persType != null">pers_type = #{persType},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwPrescriptionById" parameterType="Long">
|
||||
delete from sw_prescription where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwPrescriptionByIds" parameterType="String">
|
||||
delete from sw_prescription where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwPresDetailByPersIds" parameterType="String">
|
||||
delete from sw_pres_detail where pers_id in
|
||||
<foreach item="persId" collection="array" open="(" separator="," close=")">
|
||||
#{persId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwPresDetailByPersId" parameterType="Long">
|
||||
delete from sw_pres_detail where pers_id = #{persId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchSwPresDetail">
|
||||
insert into sw_pres_detail( id, pers_id, medi_id, dosage, unit_id, usage_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.persId}, #{item.mediId}, #{item.dosage}, #{item.unitId}, #{item.usageId})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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.biosafety.mapper.SwUnitMapper">
|
||||
|
||||
<resultMap type="SwUnit" id="SwUnitResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="unit" column="unit" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwUnitVo">
|
||||
select id, name,unit from sw_unit
|
||||
</sql>
|
||||
|
||||
<select id="selectSwUnitList" parameterType="SwUnit" resultMap="SwUnitResult">
|
||||
<include refid="selectSwUnitVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwUnitById" parameterType="Long" resultMap="SwUnitResult">
|
||||
<include refid="selectSwUnitVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwUnit" parameterType="SwUnit" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_unit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwUnit" parameterType="SwUnit">
|
||||
update sw_unit
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwUnitById" parameterType="Long">
|
||||
delete from sw_unit where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwUnitByIds" parameterType="String">
|
||||
delete from sw_unit where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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.biosafety.mapper.SwUsageMapper">
|
||||
|
||||
<resultMap type="SwUsage" id="SwUsageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSwUsageVo">
|
||||
select id, name from sw_usage
|
||||
</sql>
|
||||
|
||||
<select id="selectSwUsageList" parameterType="SwUsage" resultMap="SwUsageResult">
|
||||
<include refid="selectSwUsageVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSwUsageById" parameterType="Long" resultMap="SwUsageResult">
|
||||
<include refid="selectSwUsageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSwUsage" parameterType="SwUsage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sw_usage
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSwUsage" parameterType="SwUsage">
|
||||
update sw_usage
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSwUsageById" parameterType="Long">
|
||||
delete from sw_usage where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSwUsageByIds" parameterType="String">
|
||||
delete from sw_usage where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,216 @@
|
||||
<?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.ScLambingRecordMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap type="ScLambingRecord" id="ScLambingRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="lambsBorn" column="lambs_born" />
|
||||
<result property="survival" column="survival" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="score" column="score" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTme" column="create_tme" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 详细结果映射(包含关联信息) -->
|
||||
<resultMap type="ScLambingRecord" id="ScLambingRecordDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="lambsBorn" column="lambs_born" />
|
||||
<result property="survival" column="survival" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="score" column="score" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTme" column="create_tme" />
|
||||
|
||||
<!-- 母羊信息 -->
|
||||
<result property="femaleEarNumber" column="female_ear_number" />
|
||||
<result property="femaleBreed" column="female_breed" />
|
||||
<result property="monthAge" column="month_age" />
|
||||
<result property="currentShed" column="current_shed" />
|
||||
<result property="farm" column="farm" />
|
||||
|
||||
<!-- 公羊信息 -->
|
||||
<result property="maleEarNumber" column="male_ear_number" />
|
||||
<result property="maleBreed" column="male_breed" />
|
||||
|
||||
<!-- 配种信息 -->
|
||||
<result property="breedingDate" column="breeding_date" />
|
||||
<result property="pregnancyDays" column="pregnancy_days" />
|
||||
|
||||
<!-- 统计信息 -->
|
||||
<result property="maleCount" column="male_count" />
|
||||
<result property="femaleCount" column="female_count" />
|
||||
<result property="retainedMaleCount" column="retained_male_count" />
|
||||
<result property="retainedFemaleCount" column="retained_female_count" />
|
||||
<result property="unretainedMaleCount" column="unretained_male_count" />
|
||||
<result property="unretainedFemaleCount" column="unretained_female_count" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础查询SQL -->
|
||||
<sql id="selectScLambingRecordVo">
|
||||
select id, sheep_id, parity, lambs_born, survival, technician, score, comment, create_by, create_tme from sc_lambing_record
|
||||
</sql>
|
||||
|
||||
<!-- 详细查询SQL(包含关联信息) -->
|
||||
<sql id="selectScLambingRecordDetailVo">
|
||||
SELECT
|
||||
lr.id, lr.sheep_id, lr.parity, lr.lambs_born, lr.survival,
|
||||
lr.technician, lr.score, lr.comment, lr.create_by, lr.create_tme,
|
||||
|
||||
-- 从bas_sheep表获取母羊信息
|
||||
mother.manage_tags as female_ear_number,
|
||||
mother.variety_id as female_breed,
|
||||
TIMESTAMPDIFF(MONTH, mother.birthday, NOW()) as month_age,
|
||||
mother.sheepfold_id as current_shed,
|
||||
mother.ranch_id as farm,
|
||||
|
||||
-- 从sc_breed_record表获取配种信息
|
||||
br.create_time as breeding_date,
|
||||
DATEDIFF(lr.create_tme, br.create_time) as pregnancy_days,
|
||||
|
||||
-- 从bas_sheep表获取公羊信息
|
||||
father.manage_tags as male_ear_number,
|
||||
father.variety_id as male_breed,
|
||||
|
||||
-- 统计羔羊信息(从bas_sheep表统计,根据母羊ID)
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.is_delete = 0) as male_count,
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.is_delete = 0) as female_count,
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.status_id = 1 AND lamb.is_delete = 0) as retained_male_count,
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.status_id = 1 AND lamb.is_delete = 0) as retained_female_count,
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 1 AND lamb.status_id != 1 AND lamb.is_delete = 0) as unretained_male_count,
|
||||
(SELECT COUNT(*) FROM bas_sheep lamb WHERE lamb.mother_id = lr.sheep_id AND lamb.gender = 0 AND lamb.status_id != 1 AND lamb.is_delete = 0) as unretained_female_count
|
||||
|
||||
FROM sc_lambing_record lr
|
||||
LEFT JOIN bas_sheep mother ON lr.sheep_id = mother.id
|
||||
LEFT JOIN sc_breed_record br ON lr.sheep_id = br.ewe_id AND lr.parity = mother.parity
|
||||
LEFT JOIN bas_sheep father ON br.ram_id = father.id
|
||||
</sql>
|
||||
|
||||
<!-- 查询产羔记录列表(包含关联信息) -->
|
||||
<select id="selectScLambingRecordList" parameterType="ScLambingRecord" resultMap="ScLambingRecordDetailResult">
|
||||
<include refid="selectScLambingRecordDetailVo"/>
|
||||
<where>
|
||||
<if test="femaleEarNumber != null and femaleEarNumber != ''"> and mother.manage_tags LIKE CONCAT('%', #{femaleEarNumber}, '%')</if>
|
||||
<if test="femaleBreed != null and femaleBreed != ''"> and mother.variety_id = #{femaleBreed}</if>
|
||||
<if test="farm != null and farm != ''"> and mother.ranch_id = #{farm}</if>
|
||||
<if test="sheepId != null and sheepId != ''"> and lr.sheep_id = #{sheepId}</if>
|
||||
<if test="parity != null"> and lr.parity = #{parity}</if>
|
||||
<if test="lambsBorn != null"> and lr.lambs_born = #{lambsBorn}</if>
|
||||
<if test="survival != null"> and lr.survival = #{survival}</if>
|
||||
<if test="technician != null and technician != ''"> and lr.technician LIKE CONCAT('%', #{technician}, '%')</if>
|
||||
<if test="score != null"> and lr.score = #{score}</if>
|
||||
<if test="comment != null and comment != ''"> and lr.comment LIKE CONCAT('%', #{comment}, '%')</if>
|
||||
<if test="createBy != null and createBy != ''"> and lr.create_by = #{createBy}</if>
|
||||
<if test="createTme != null"> and DATE(lr.create_tme) = #{createTme}</if>
|
||||
<if test="params.beginBreedingDate != null and params.beginBreedingDate != ''"><!-- 配种日期开始 -->
|
||||
and DATE(br.create_time) >= #{params.beginBreedingDate}
|
||||
</if>
|
||||
<if test="params.endBreedingDate != null and params.endBreedingDate != ''"><!-- 配种日期结束 -->
|
||||
and DATE(br.create_time) <= #{params.endBreedingDate}
|
||||
</if>
|
||||
and mother.is_delete = 0
|
||||
</where>
|
||||
ORDER BY lr.create_tme DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询产羔记录基础信息 -->
|
||||
<select id="selectScLambingRecordById" parameterType="Long" resultMap="ScLambingRecordResult">
|
||||
<include refid="selectScLambingRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 查询产羔记录详细信息(包含关联信息) -->
|
||||
<select id="selectScLambingRecordDetailById" parameterType="Long" resultMap="ScLambingRecordDetailResult">
|
||||
<include refid="selectScLambingRecordDetailVo"/>
|
||||
where lr.id = #{id} and mother.is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 查询羔羊详情(从bas_sheep表查询) -->
|
||||
<select id="selectLambDetailByLambingRecordId" parameterType="Long" resultType="map">
|
||||
SELECT
|
||||
sheep.manage_tags as lambEarNumber,
|
||||
sheep.variety_id as lambBreed,
|
||||
CASE sheep.gender
|
||||
WHEN 1 THEN 'male'
|
||||
WHEN 0 THEN 'female'
|
||||
ELSE 'unknown'
|
||||
END as gender,
|
||||
sheep.birth_weight as birthWeight,
|
||||
CASE sheep.status_id
|
||||
WHEN 1 THEN true
|
||||
ELSE false
|
||||
END as isRetained,
|
||||
sheep.family as lineage,
|
||||
sheep.birthday
|
||||
FROM bas_sheep sheep
|
||||
WHERE sheep.mother_id = (SELECT sheep_id FROM sc_lambing_record WHERE id = #{lambingRecordId})
|
||||
AND sheep.is_delete = 0
|
||||
ORDER BY sheep.birthday ASC
|
||||
</select>
|
||||
|
||||
<!-- 新增产羔记录 -->
|
||||
<insert id="insertScLambingRecord" parameterType="ScLambingRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_lambing_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="parity != null">parity,</if>
|
||||
<if test="lambsBorn != null">lambs_born,</if>
|
||||
<if test="survival != null">survival,</if>
|
||||
<if test="technician != null">technician,</if>
|
||||
<if test="score != null">score,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTme != null">create_tme,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="parity != null">#{parity},</if>
|
||||
<if test="lambsBorn != null">#{lambsBorn},</if>
|
||||
<if test="survival != null">#{survival},</if>
|
||||
<if test="technician != null">#{technician},</if>
|
||||
<if test="score != null">#{score},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTme != null">#{createTme},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 修改产羔记录 -->
|
||||
<update id="updateScLambingRecord" parameterType="ScLambingRecord">
|
||||
update sc_lambing_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="parity != null">parity = #{parity},</if>
|
||||
<if test="lambsBorn != null">lambs_born = #{lambsBorn},</if>
|
||||
<if test="survival != null">survival = #{survival},</if>
|
||||
<if test="technician != null">technician = #{technician},</if>
|
||||
<if test="score != null">score = #{score},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTme != null">create_tme = #{createTme},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除产羔记录 -->
|
||||
<delete id="deleteScLambingRecordById" parameterType="Long">
|
||||
delete from sc_lambing_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量删除产羔记录 -->
|
||||
<delete id="deleteScLambingRecordByIds" parameterType="String">
|
||||
delete from sc_lambing_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?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.manage_sheep.add_sheep.mapper.ScAddSheepMapper">
|
||||
<resultMap type="com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep" id="ScAddSheepResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="father" column="father" />
|
||||
<result property="mother" column="mother" />
|
||||
<result property="bornWeight" column="born_weight" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="varietyId" column="variety_id" />
|
||||
<result property="joinDate" column="join_date" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert" parameterType="ScAddSheep" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO sc_add_sheep
|
||||
(sheep_id, sheepfold, father, mother, born_weight, birthday, gender, parity,
|
||||
variety_id, join_date, comment, technician, create_by, create_time)
|
||||
VALUES
|
||||
(#{sheepId}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday},
|
||||
#{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician},
|
||||
#{createBy}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
|
||||
SELECT * FROM sc_add_sheep
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''">AND sheep_id LIKE CONCAT('%', #{sheepId}, '%')</if>
|
||||
<!-- 其他字段同理,按需扩展 -->
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateScAddSheep" parameterType="ScAddSheep">
|
||||
UPDATE sc_add_sheep
|
||||
<set>
|
||||
sheep_id = #{sheepId},
|
||||
sheepfold = #{sheepfold},
|
||||
father = #{father},
|
||||
mother = #{mother},
|
||||
born_weight = #{bornWeight},
|
||||
birthday = #{birthday},
|
||||
gender = #{gender},
|
||||
parity = #{parity},
|
||||
variety_id = #{varietyId},
|
||||
join_date = #{joinDate},
|
||||
comment = #{comment},
|
||||
technician = #{technician},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScAddSheepByIds">
|
||||
DELETE FROM sc_add_sheep WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?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.manage_sheep.trans_group.mapper.ScTransGroupMapper">
|
||||
|
||||
<resultMap type="ScTransGroup" id="ScTransGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="foldTo" column="fold_to" />
|
||||
<result property="foldFrom" column="fold_from" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="status" column="status" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScTransGroupVo">
|
||||
select id, sheep_id, fold_to, fold_from, reason, technician, status, comment, create_by, create_time from sc_trans_group
|
||||
</sql>
|
||||
|
||||
<select id="selectScTransGroupList" parameterType="ScTransGroup" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="foldTo != null and foldTo != ''"> and fold_to = #{foldTo}</if>
|
||||
<if test="foldFrom != null and foldFrom != ''"> and fold_from = #{foldFrom}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScTransGroupById" parameterType="Integer" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScTransGroup" parameterType="ScTransGroup" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_trans_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="foldTo != null and foldTo != ''">fold_to,</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">fold_from,</if>
|
||||
<if test="reason != null and reason != ''">reason,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="status != null">status,</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="sheepId != null">#{sheepId},</if>
|
||||
<if test="foldTo != null and foldTo != ''">#{foldTo},</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">#{foldFrom},</if>
|
||||
<if test="reason != null and reason != ''">#{reason},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScTransGroup" parameterType="ScTransGroup">
|
||||
update sc_trans_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="foldTo != null and foldTo != ''">fold_to = #{foldTo},</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">fold_from = #{foldFrom},</if>
|
||||
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="status != null">status = #{status},</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="deleteScTransGroupById" parameterType="Integer">
|
||||
delete from sc_trans_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScTransGroupByIds" parameterType="String">
|
||||
delete from sc_trans_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?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.manage_sheep.transition_info.mapper.ScTransitionInfoMapper">
|
||||
<resultMap type="ScTransitionInfo" id="ScTransitionInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="transTo" column="trans_to" />
|
||||
<result property="transFrom" column="trans_from" />
|
||||
<result property="transType" column="trans_type" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="status" column="status" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScTransitionInfoVo">
|
||||
select id, sheep_id, trans_to, trans_from, trans_type, technician, status, comment, create_by, create_time from sc_transition_info
|
||||
</sql>
|
||||
|
||||
<select id="selectScTransitionInfoList" parameterType="ScTransitionInfo" resultMap="ScTransitionInfoResult">
|
||||
<include refid="selectScTransitionInfoVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="transTo != null and transTo != ''"> and trans_to = #{transTo}</if>
|
||||
<if test="transFrom != null and transFrom != ''"> and trans_from = #{transFrom}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScTransitionInfoById" parameterType="Integer" resultMap="ScTransitionInfoResult">
|
||||
<include refid="selectScTransitionInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScTransitionInfo" parameterType="ScTransitionInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_transition_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="transTo != null and transTo != ''">trans_to,</if>
|
||||
<if test="transFrom != null and transFrom != ''">trans_from,</if>
|
||||
<if test="transType != null">trans_type,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="status != null">status,</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="sheepId != null">#{sheepId},</if>
|
||||
<if test="transTo != null and transTo != ''">#{transTo},</if>
|
||||
<if test="transFrom != null and transFrom != ''">#{transFrom},</if>
|
||||
<if test="transType != null">#{transType},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScTransitionInfo" parameterType="ScTransitionInfo">
|
||||
update sc_transition_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="transTo != null and transTo != ''">trans_to = #{transTo},</if>
|
||||
<if test="transFrom != null and transFrom != ''">trans_from = #{transFrom},</if>
|
||||
<if test="transType != null">trans_type = #{transType},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="status != null">status = #{status},</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="deleteScTransitionInfoById" parameterType="Integer">
|
||||
delete from sc_transition_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScTransitionInfoByIds" parameterType="String">
|
||||
delete from sc_transition_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -1,36 +1,47 @@
|
||||
<?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.mapper.ScCastrateMapper">
|
||||
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.produce.other.castrate.mapper.ScCastrateMapper">
|
||||
|
||||
<resultMap type="ScCastrate" id="ScCastrateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="sheepId" column="sheep_id"/>
|
||||
<result property="sheepfold" column="sheepfold"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScCastrateVo">
|
||||
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_castrate
|
||||
select sc.id,
|
||||
sc.sheep_id,
|
||||
sc.sheepfold,
|
||||
sf.sheepfold_name as sheepfoldName,
|
||||
sc.comment,
|
||||
sc.technician,
|
||||
sc.create_by,
|
||||
sc.create_time
|
||||
from sc_castrate sc
|
||||
left join da_sheepfold sf on sc.sheepfold = sf.id
|
||||
</sql>
|
||||
|
||||
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''"> and sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null "> and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||
<if test="technician != null and technician != ''"> and technician like concat('%', #{technician}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''">and sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null ">and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||
<if test="technician != null and technician != ''">and technician like concat('%', #{technician}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||||
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectScCastrateById" parameterType="Long" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
where id = #{id}
|
||||
where sc.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScCastrate" parameterType="ScCastrate" useGeneratedKeys="true" keyProperty="id">
|
||||
@@ -42,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="technician != null">technician,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="sheepfold != null">#{sheepfold},</if>
|
||||
@@ -50,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="technician != null">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScCastrate" parameterType="ScCastrate">
|
||||
@@ -67,11 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteScCastrateById" parameterType="Long">
|
||||
delete from sc_castrate where id = #{id}
|
||||
delete
|
||||
from sc_castrate
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScCastrateByIds" parameterType="String">
|
||||
delete from sc_castrate where id in
|
||||
delete from sc_castrate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.other.fixHoof.mapper.ScFixHoofMapper">
|
||||
|
||||
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="sheepId" column="sheep_id" />
|
||||
<result property="sheepfold" column="sheepfold" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="technician" column="technician" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScFixHoofVo">
|
||||
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_fix_hoof
|
||||
</sql>
|
||||
|
||||
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
||||
<include refid="selectScFixHoofVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null "> and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepfold != null "> and sheepfold = #{sheepfold}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectScFixHoofById" parameterType="Long" resultMap="ScFixHoofResult">
|
||||
<include refid="selectScFixHoofVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_fix_hoof
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id,</if>
|
||||
<if test="sheepfold != null">sheepfold,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null">#{sheepId},</if>
|
||||
<if test="sheepfold != null">#{sheepfold},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
||||
update sc_fix_hoof
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteScFixHoofById" parameterType="Long">
|
||||
delete from sc_fix_hoof where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteScFixHoofByIds" parameterType="String">
|
||||
delete from sc_fix_hoof where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -2,44 +2,68 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.sheep_file.mapper.BasSheepMapper">
|
||||
<mapper namespace="com.zhyc.module.sheep_file.mapper.SheepFileMapper">
|
||||
|
||||
<resultMap type="BasSheep" id="BasSheepResult">
|
||||
<resultMap type="SheepFile" id="SheepFileResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="manageTags" column="manage_tags" />
|
||||
<result property="bsManageTags" column="bs_manage_tags" />
|
||||
<result property="ranchId" column="ranch_id" />
|
||||
<result property="drRanch" column="dr_ranch" />
|
||||
<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="family" column="family" />
|
||||
<result property="typeId" column="type_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="birthWeight" column="birth_weight" />
|
||||
<result property="dayAge" column="day_age" />
|
||||
<result property="monthAge" column="month_age" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="statusId" column="status_id" />
|
||||
<result property="birthWeight" column="birth_weight" />
|
||||
<result property="weaningDate" column="weaning_date" />
|
||||
<result property="statusId" column="status_id" />
|
||||
<result property="weaningWeight" column="weaning_weight" />
|
||||
<result property="currentWeight" column="current_weight" />
|
||||
<result property="breedStatusId" column="breed_status_id" />
|
||||
<result property="fatherId" column="father_id" />
|
||||
<result property="motherId" column="mother_id" />
|
||||
<result property="breed" column="breed" />
|
||||
<result property="bsFatherId" column="bs_father_id" />
|
||||
<result property="fatherManageTags" column="father_manage_tags" />
|
||||
<result property="bsMotherId" column="bs_mother_id" />
|
||||
<result property="motherManageTags" column="mother_manage_tags" />
|
||||
<result property="receptorId" column="receptor_id" />
|
||||
<result property="receptorManageTags" column="receptor_manage_tags" />
|
||||
<result property="fatherFatherId" column="father_father_id" />
|
||||
<result property="grandfatherManageTags" column="grandfather_manage_tags" />
|
||||
<result property="fatherMotherId" column="father_mother_id" />
|
||||
<result property="grandmotherManageTags" column="grandmother_manage_tags" />
|
||||
<result property="fatherId" column="father_id" />
|
||||
<result property="maternalGrandfatherManageTags" column="maternal_grandfather_manage_tags" />
|
||||
<result property="motherId" column="mother_id" />
|
||||
<result property="maternalGrandmotherManageTags" column="maternal_grandmother_manage_tags" />
|
||||
<result property="matingDate" column="mating_date" />
|
||||
<result property="matingTypeId" column="mating_type_id" />
|
||||
<result property="pregDate" column="preg_date" />
|
||||
<result property="lambingDate" column="lambing_date" />
|
||||
<result property="lambingDay" column="lambing_day" />
|
||||
<result property="matingDay" column="mating_day" />
|
||||
<result property="gestationDay" column="gestation_day" />
|
||||
<result property="expectedDate" column="expected_date" />
|
||||
<result property="controlled" column="controlled" />
|
||||
<result property="postLambingDay" column="post_lambing_day" />
|
||||
<result property="lactationDay" column="lactation_day" />
|
||||
<result property="anestrousDay" column="anestrous_day" />
|
||||
<result property="matingCounts" column="mating_counts" />
|
||||
<result property="matingTotal" column="mating_total" />
|
||||
<result property="miscarriageCounts" column="miscarriage_counts" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="controlled" column="controlled" />
|
||||
<result property="body" column="body" />
|
||||
<result property="breast" column="breast" />
|
||||
<result property="source" column="source" />
|
||||
<result property="soureDate" column="soure_date" />
|
||||
<result property="sourceDate" column="source_date" />
|
||||
<result property="sourceRanchId" column="source_ranch_id" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="sourceRanch" column="source_ranch" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
@@ -47,93 +71,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasSheepVo">
|
||||
select id, manage_tags, ranch_id, sheepfold_id, electronic_tags, variety_id, family, type_id, gender, birthday, birth_weight, parity, status_id, weaning_date, weaning_weight, breed_status_id, father_id, mother_id, receptor_id, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, expected_date, controlled, mating_counts, mating_total, miscarriage_counts, body, breast, source, soure_date, source_ranch_id, comment, update_by, update_time, create_by, create_time, is_delete from bas_sheep
|
||||
<sql id="selectSheepFileVo">
|
||||
select id, bs_manage_tags, ranch_id, dr_ranch, sheepfold_id, sheepfold_name, electronic_tags, variety_id, variety, family, name, gender, birthday, day_age, month_age, parity, birth_weight, weaning_date, status_id, weaning_weight, current_weight, breed_status_id, breed, bs_father_id, father_manage_tags, bs_mother_id, mother_manage_tags, receptor_id, receptor_manage_tags, father_father_id, grandfather_manage_tags, father_mother_id, grandmother_manage_tags, father_id, maternal_grandfather_manage_tags, mother_id, maternal_grandmother_manage_tags, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, mating_day, gestation_day, expected_date, post_lambing_day, lactation_day, anestrous_day, mating_counts, mating_total, miscarriage_counts, comment, controlled, body, breast, source, source_date, source_ranch_id, source_ranch, update_by, update_time, create_by, create_time, is_delete from sheep_file
|
||||
</sql>
|
||||
|
||||
<select id="selectBasSheepList" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<select id="selectSheepFileList" parameterType="SheepFile" resultMap="SheepFileResult">
|
||||
<include refid="selectSheepFileVo"/>
|
||||
<where>
|
||||
<if test="manageTags != null and manageTags != ''"> and manage_tags = #{manageTags}</if>
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="bsManageTags != null and bsManageTags != ''"> and bs_manage_tags = #{bsManageTags}</if>
|
||||
<if test="drRanch != null and drRanch != ''"> and dr_ranch = #{drRanch}</if>
|
||||
<if test="electronicTags != null and electronicTags != ''"> and electronic_tags = #{electronicTags}</if>
|
||||
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
|
||||
<if test="family != null and family != ''"> and family = #{family}</if>
|
||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
||||
<if test="variety != null and variety != ''"> and variety = #{variety}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="birthWeight != null "> and birth_weight = #{birthWeight}</if>
|
||||
<if test="parity != null "> and parity = #{parity}</if>
|
||||
<if test="statusId != null "> and status_id = #{statusId}</if>
|
||||
<if test="weaningDate != null "> and weaning_date = #{weaningDate}</if>
|
||||
<if test="weaningWeight != null "> and weaning_weight = #{weaningWeight}</if>
|
||||
<if test="breedStatusId != null "> and breed_status_id = #{breedStatusId}</if>
|
||||
<if test="fatherId != null "> and father_id = #{fatherId}</if>
|
||||
<if test="motherId != null "> and mother_id = #{motherId}</if>
|
||||
<if test="receptorId != null "> and receptor_id = #{receptorId}</if>
|
||||
<if test="matingDate != null "> and mating_date = #{matingDate}</if>
|
||||
<if test="matingTypeId != null "> and mating_type_id = #{matingTypeId}</if>
|
||||
<if test="pregDate != null "> and preg_date = #{pregDate}</if>
|
||||
<if test="lambingDate != null "> and lambing_date = #{lambingDate}</if>
|
||||
<if test="lambingDay != null "> and lambing_day = #{lambingDay}</if>
|
||||
<if test="expectedDate != null "> and expected_date = #{expectedDate}</if>
|
||||
<if test="controlled != null "> and controlled = #{controlled}</if>
|
||||
<if test="matingCounts != null "> and mating_counts = #{matingCounts}</if>
|
||||
<if test="matingTotal != null "> and mating_total = #{matingTotal}</if>
|
||||
<if test="miscarriageCounts != null "> and miscarriage_counts = #{miscarriageCounts}</if>
|
||||
<if test="body != null "> and body = #{body}</if>
|
||||
<if test="breast != null "> and breast = #{breast}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="soureDate != null "> and soure_date = #{soureDate}</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="breed != null and breed != ''"> and breed = #{breed}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepById" parameterType="Long" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<select id="selectSheepFileById" parameterType="Long" resultMap="SheepFileResult">
|
||||
<include refid="selectSheepFileVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBasSheep" parameterType="BasSheep" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bas_sheep
|
||||
<insert id="insertSheepFile" parameterType="SheepFile">
|
||||
insert into sheep_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="manageTags != null">manage_tags,</if>
|
||||
<if test="id != null">id,</if>
|
||||
<if test="bsManageTags != null">bs_manage_tags,</if>
|
||||
<if test="ranchId != null">ranch_id,</if>
|
||||
<if test="drRanch != null">dr_ranch,</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="family != null">family,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="gender != null">gender,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="birthWeight != null">birth_weight,</if>
|
||||
<if test="dayAge != null">day_age,</if>
|
||||
<if test="monthAge != null">month_age,</if>
|
||||
<if test="parity != null">parity,</if>
|
||||
<if test="statusId != null">status_id,</if>
|
||||
<if test="birthWeight != null">birth_weight,</if>
|
||||
<if test="weaningDate != null">weaning_date,</if>
|
||||
<if test="statusId != null">status_id,</if>
|
||||
<if test="weaningWeight != null">weaning_weight,</if>
|
||||
<if test="currentWeight != null">current_weight,</if>
|
||||
<if test="breedStatusId != null">breed_status_id,</if>
|
||||
<if test="fatherId != null">father_id,</if>
|
||||
<if test="motherId != null">mother_id,</if>
|
||||
<if test="breed != null">breed,</if>
|
||||
<if test="bsFatherId != null">bs_father_id,</if>
|
||||
<if test="fatherManageTags != null">father_manage_tags,</if>
|
||||
<if test="bsMotherId != null">bs_mother_id,</if>
|
||||
<if test="motherManageTags != null">mother_manage_tags,</if>
|
||||
<if test="receptorId != null">receptor_id,</if>
|
||||
<if test="receptorManageTags != null">receptor_manage_tags,</if>
|
||||
<if test="fatherFatherId != null">father_father_id,</if>
|
||||
<if test="grandfatherManageTags != null">grandfather_manage_tags,</if>
|
||||
<if test="fatherMotherId != null">father_mother_id,</if>
|
||||
<if test="grandmotherManageTags != null">grandmother_manage_tags,</if>
|
||||
<if test="fatherId != null">father_id,</if>
|
||||
<if test="maternalGrandfatherManageTags != null">maternal_grandfather_manage_tags,</if>
|
||||
<if test="motherId != null">mother_id,</if>
|
||||
<if test="maternalGrandmotherManageTags != null">maternal_grandmother_manage_tags,</if>
|
||||
<if test="matingDate != null">mating_date,</if>
|
||||
<if test="matingTypeId != null">mating_type_id,</if>
|
||||
<if test="pregDate != null">preg_date,</if>
|
||||
<if test="lambingDate != null">lambing_date,</if>
|
||||
<if test="lambingDay != null">lambing_day,</if>
|
||||
<if test="matingDay != null">mating_day,</if>
|
||||
<if test="gestationDay != null">gestation_day,</if>
|
||||
<if test="expectedDate != null">expected_date,</if>
|
||||
<if test="controlled != null">controlled,</if>
|
||||
<if test="postLambingDay != null">post_lambing_day,</if>
|
||||
<if test="lactationDay != null">lactation_day,</if>
|
||||
<if test="anestrousDay != null">anestrous_day,</if>
|
||||
<if test="matingCounts != null">mating_counts,</if>
|
||||
<if test="matingTotal != null">mating_total,</if>
|
||||
<if test="miscarriageCounts != null">miscarriage_counts,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="controlled != null">controlled,</if>
|
||||
<if test="body != null">body,</if>
|
||||
<if test="breast != null">breast,</if>
|
||||
<if test="source != null">source,</if>
|
||||
<if test="soureDate != null">soure_date,</if>
|
||||
<if test="sourceDate != null">source_date,</if>
|
||||
<if test="sourceRanchId != null">source_ranch_id,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="sourceRanch != null">source_ranch,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@@ -141,40 +164,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="manageTags != null">#{manageTags},</if>
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="bsManageTags != null">#{bsManageTags},</if>
|
||||
<if test="ranchId != null">#{ranchId},</if>
|
||||
<if test="drRanch != null">#{drRanch},</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="family != null">#{family},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="gender != null">#{gender},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="birthWeight != null">#{birthWeight},</if>
|
||||
<if test="dayAge != null">#{dayAge},</if>
|
||||
<if test="monthAge != null">#{monthAge},</if>
|
||||
<if test="parity != null">#{parity},</if>
|
||||
<if test="statusId != null">#{statusId},</if>
|
||||
<if test="birthWeight != null">#{birthWeight},</if>
|
||||
<if test="weaningDate != null">#{weaningDate},</if>
|
||||
<if test="statusId != null">#{statusId},</if>
|
||||
<if test="weaningWeight != null">#{weaningWeight},</if>
|
||||
<if test="currentWeight != null">#{currentWeight},</if>
|
||||
<if test="breedStatusId != null">#{breedStatusId},</if>
|
||||
<if test="fatherId != null">#{fatherId},</if>
|
||||
<if test="motherId != null">#{motherId},</if>
|
||||
<if test="breed != null">#{breed},</if>
|
||||
<if test="bsFatherId != null">#{bsFatherId},</if>
|
||||
<if test="fatherManageTags != null">#{fatherManageTags},</if>
|
||||
<if test="bsMotherId != null">#{bsMotherId},</if>
|
||||
<if test="motherManageTags != null">#{motherManageTags},</if>
|
||||
<if test="receptorId != null">#{receptorId},</if>
|
||||
<if test="receptorManageTags != null">#{receptorManageTags},</if>
|
||||
<if test="fatherFatherId != null">#{fatherFatherId},</if>
|
||||
<if test="grandfatherManageTags != null">#{grandfatherManageTags},</if>
|
||||
<if test="fatherMotherId != null">#{fatherMotherId},</if>
|
||||
<if test="grandmotherManageTags != null">#{grandmotherManageTags},</if>
|
||||
<if test="fatherId != null">#{fatherId},</if>
|
||||
<if test="maternalGrandfatherManageTags != null">#{maternalGrandfatherManageTags},</if>
|
||||
<if test="motherId != null">#{motherId},</if>
|
||||
<if test="maternalGrandmotherManageTags != null">#{maternalGrandmotherManageTags},</if>
|
||||
<if test="matingDate != null">#{matingDate},</if>
|
||||
<if test="matingTypeId != null">#{matingTypeId},</if>
|
||||
<if test="pregDate != null">#{pregDate},</if>
|
||||
<if test="lambingDate != null">#{lambingDate},</if>
|
||||
<if test="lambingDay != null">#{lambingDay},</if>
|
||||
<if test="matingDay != null">#{matingDay},</if>
|
||||
<if test="gestationDay != null">#{gestationDay},</if>
|
||||
<if test="expectedDate != null">#{expectedDate},</if>
|
||||
<if test="controlled != null">#{controlled},</if>
|
||||
<if test="postLambingDay != null">#{postLambingDay},</if>
|
||||
<if test="lactationDay != null">#{lactationDay},</if>
|
||||
<if test="anestrousDay != null">#{anestrousDay},</if>
|
||||
<if test="matingCounts != null">#{matingCounts},</if>
|
||||
<if test="matingTotal != null">#{matingTotal},</if>
|
||||
<if test="miscarriageCounts != null">#{miscarriageCounts},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="controlled != null">#{controlled},</if>
|
||||
<if test="body != null">#{body},</if>
|
||||
<if test="breast != null">#{breast},</if>
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="soureDate != null">#{soureDate},</if>
|
||||
<if test="sourceDate != null">#{sourceDate},</if>
|
||||
<if test="sourceRanchId != null">#{sourceRanchId},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="sourceRanch != null">#{sourceRanch},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
@@ -183,43 +231,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasSheep" parameterType="BasSheep">
|
||||
update bas_sheep
|
||||
<update id="updateSheepFile" parameterType="SheepFile">
|
||||
update sheep_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="manageTags != null">manage_tags = #{manageTags},</if>
|
||||
<if test="bsManageTags != null">bs_manage_tags = #{bsManageTags},</if>
|
||||
<if test="ranchId != null">ranch_id = #{ranchId},</if>
|
||||
<if test="drRanch != null">dr_ranch = #{drRanch},</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="family != null">family = #{family},</if>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="gender != null">gender = #{gender},</if>
|
||||
<if test="birthday != null">birthday = #{birthday},</if>
|
||||
<if test="birthWeight != null">birth_weight = #{birthWeight},</if>
|
||||
<if test="dayAge != null">day_age = #{dayAge},</if>
|
||||
<if test="monthAge != null">month_age = #{monthAge},</if>
|
||||
<if test="parity != null">parity = #{parity},</if>
|
||||
<if test="statusId != null">status_id = #{statusId},</if>
|
||||
<if test="birthWeight != null">birth_weight = #{birthWeight},</if>
|
||||
<if test="weaningDate != null">weaning_date = #{weaningDate},</if>
|
||||
<if test="statusId != null">status_id = #{statusId},</if>
|
||||
<if test="weaningWeight != null">weaning_weight = #{weaningWeight},</if>
|
||||
<if test="currentWeight != null">current_weight = #{currentWeight},</if>
|
||||
<if test="breedStatusId != null">breed_status_id = #{breedStatusId},</if>
|
||||
<if test="fatherId != null">father_id = #{fatherId},</if>
|
||||
<if test="motherId != null">mother_id = #{motherId},</if>
|
||||
<if test="breed != null">breed = #{breed},</if>
|
||||
<if test="bsFatherId != null">bs_father_id = #{bsFatherId},</if>
|
||||
<if test="fatherManageTags != null">father_manage_tags = #{fatherManageTags},</if>
|
||||
<if test="bsMotherId != null">bs_mother_id = #{bsMotherId},</if>
|
||||
<if test="motherManageTags != null">mother_manage_tags = #{motherManageTags},</if>
|
||||
<if test="receptorId != null">receptor_id = #{receptorId},</if>
|
||||
<if test="receptorManageTags != null">receptor_manage_tags = #{receptorManageTags},</if>
|
||||
<if test="fatherFatherId != null">father_father_id = #{fatherFatherId},</if>
|
||||
<if test="grandfatherManageTags != null">grandfather_manage_tags = #{grandfatherManageTags},</if>
|
||||
<if test="fatherMotherId != null">father_mother_id = #{fatherMotherId},</if>
|
||||
<if test="grandmotherManageTags != null">grandmother_manage_tags = #{grandmotherManageTags},</if>
|
||||
<if test="fatherId != null">father_id = #{fatherId},</if>
|
||||
<if test="maternalGrandfatherManageTags != null">maternal_grandfather_manage_tags = #{maternalGrandfatherManageTags},</if>
|
||||
<if test="motherId != null">mother_id = #{motherId},</if>
|
||||
<if test="maternalGrandmotherManageTags != null">maternal_grandmother_manage_tags = #{maternalGrandmotherManageTags},</if>
|
||||
<if test="matingDate != null">mating_date = #{matingDate},</if>
|
||||
<if test="matingTypeId != null">mating_type_id = #{matingTypeId},</if>
|
||||
<if test="pregDate != null">preg_date = #{pregDate},</if>
|
||||
<if test="lambingDate != null">lambing_date = #{lambingDate},</if>
|
||||
<if test="lambingDay != null">lambing_day = #{lambingDay},</if>
|
||||
<if test="matingDay != null">mating_day = #{matingDay},</if>
|
||||
<if test="gestationDay != null">gestation_day = #{gestationDay},</if>
|
||||
<if test="expectedDate != null">expected_date = #{expectedDate},</if>
|
||||
<if test="controlled != null">controlled = #{controlled},</if>
|
||||
<if test="postLambingDay != null">post_lambing_day = #{postLambingDay},</if>
|
||||
<if test="lactationDay != null">lactation_day = #{lactationDay},</if>
|
||||
<if test="anestrousDay != null">anestrous_day = #{anestrousDay},</if>
|
||||
<if test="matingCounts != null">mating_counts = #{matingCounts},</if>
|
||||
<if test="matingTotal != null">mating_total = #{matingTotal},</if>
|
||||
<if test="miscarriageCounts != null">miscarriage_counts = #{miscarriageCounts},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="controlled != null">controlled = #{controlled},</if>
|
||||
<if test="body != null">body = #{body},</if>
|
||||
<if test="breast != null">breast = #{breast},</if>
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="soureDate != null">soure_date = #{soureDate},</if>
|
||||
<if test="sourceDate != null">source_date = #{sourceDate},</if>
|
||||
<if test="sourceRanchId != null">source_ranch_id = #{sourceRanchId},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="sourceRanch != null">source_ranch = #{sourceRanch},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
@@ -229,12 +301,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasSheepById" parameterType="Long">
|
||||
delete from bas_sheep where id = #{id}
|
||||
<delete id="deleteSheepFileById" parameterType="Long">
|
||||
delete from sheep_file where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasSheepByIds" parameterType="String">
|
||||
delete from bas_sheep where id in
|
||||
<delete id="deleteSheepFileByIds" parameterType="String">
|
||||
delete from sheep_file where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
Reference in New Issue
Block a user