修改羊只分组功能
This commit is contained in:
parent
a2d5c34995
commit
f33bf93714
@ -23,6 +23,10 @@
|
|||||||
<version>1.18.38</version> <!-- 使用最新版本 -->
|
<version>1.18.38</version> <!-- 使用最新版本 -->
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -52,18 +52,21 @@ public class ScAddSheep extends BaseEntity {
|
|||||||
@Excel(name = "出生日期", dateFormat = "yyyy-MM-dd")
|
@Excel(name = "出生日期", dateFormat = "yyyy-MM-dd")
|
||||||
private Date birthday;
|
private Date birthday;
|
||||||
|
|
||||||
/** 性别 1公 0母 */
|
/** 性别 1公 0母 2阉羊 3兼性 */
|
||||||
@Excel(name = "性别", readConverterExp = "1=公,0=母")
|
@Excel(name = "性别", readConverterExp = "1=公,0=母,2=阉羊,3=兼性")
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
|
|
||||||
/** 胎次 */
|
/** 胎次 */
|
||||||
@Excel(name = "胎次")
|
@Excel(name = "胎次")
|
||||||
private Integer parity;
|
private Integer parity;
|
||||||
|
|
||||||
/** 品种编号 */
|
/** 品种id */
|
||||||
@Excel(name = "品种编号")
|
|
||||||
private Integer varietyId;
|
private Integer varietyId;
|
||||||
|
|
||||||
|
/** 品种名称(联表查询返回,非数据库字段) */
|
||||||
|
@Excel(name = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
/** 入群日期 */
|
/** 入群日期 */
|
||||||
@Excel(name = "入群日期", dateFormat = "yyyy-MM-dd")
|
@Excel(name = "入群日期", dateFormat = "yyyy-MM-dd")
|
||||||
private Date joinDate;
|
private Date joinDate;
|
||||||
|
@ -66,6 +66,13 @@ public class ScTransGroup extends BaseEntity {
|
|||||||
@Excel(name = "品种")
|
@Excel(name = "品种")
|
||||||
private String varietyName;
|
private String varietyName;
|
||||||
|
|
||||||
|
/** 品种id */
|
||||||
|
private Long varietyId;
|
||||||
|
|
||||||
|
/** 品种名称(联表查询返回,非数据库字段) */
|
||||||
|
@Excel(name = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
private Integer reason;
|
private Integer reason;
|
||||||
/**
|
/**
|
||||||
* 转群原因描述 用于导出
|
* 转群原因描述 用于导出
|
||||||
|
@ -51,8 +51,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
|||||||
group.setStatusText(convertStatus(group.getStatus()));
|
group.setStatusText(convertStatus(group.getStatus()));
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
// return scTransGroupMapper.selectScTransGroupList(scTransGroup);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package com.zhyc.module.produce.other.castrate.domain;
|
package com.zhyc.module.produce.other.castrate.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.zhyc.common.annotation.Excel;
|
import com.zhyc.common.annotation.Excel;
|
||||||
@ -11,6 +14,9 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-07-09
|
* @date 2025-07-09
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class ScCastrate extends BaseEntity {
|
public class ScCastrate extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -36,6 +42,13 @@ public class ScCastrate extends BaseEntity {
|
|||||||
@Excel(name = "羊舍名称")
|
@Excel(name = "羊舍名称")
|
||||||
private String sheepfoldName;
|
private String sheepfoldName;
|
||||||
|
|
||||||
|
/** 品种id */
|
||||||
|
private Long varietyId;
|
||||||
|
|
||||||
|
/** 品种名称(联表查询返回,非数据库字段) */
|
||||||
|
@Excel(name = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@ -50,63 +63,5 @@ public class ScCastrate extends BaseEntity {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSheepId(String sheepId) {
|
|
||||||
this.sheepId = sheepId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSheepId() {
|
|
||||||
return sheepId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSheepfold(Long sheepfold) {
|
|
||||||
this.sheepfold = sheepfold;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getSheepfold() {
|
|
||||||
return sheepfold;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setComment(String comment) {
|
|
||||||
this.comment = comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getComment() {
|
|
||||||
return comment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTechnician(String technician) {
|
|
||||||
this.technician = technician;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTechnician() {
|
|
||||||
return technician;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSheepfoldName() {
|
|
||||||
return sheepfoldName;
|
|
||||||
}
|
|
||||||
public void setSheepfoldName(String sheepfoldName) {
|
|
||||||
this.sheepfoldName = sheepfoldName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("sheepId", getSheepId())
|
|
||||||
.append("sheepfold", getSheepfold())
|
|
||||||
.append("comment", getComment())
|
|
||||||
.append("technician", getTechnician())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,13 @@ public class ScFixHoof extends BaseEntity
|
|||||||
@Excel(name = "羊舍名称")
|
@Excel(name = "羊舍名称")
|
||||||
private String sheepfoldName;
|
private String sheepfoldName;
|
||||||
|
|
||||||
|
/** 品种id */
|
||||||
|
private Long varietyId;
|
||||||
|
|
||||||
|
/** 品种名称(联表查询返回,非数据库字段) */
|
||||||
|
@Excel(name = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
@Excel(name = "备注")
|
@Excel(name = "备注")
|
||||||
private String comment;
|
private String comment;
|
||||||
|
@ -4,78 +4,94 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.zhyc.module.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper">
|
<mapper namespace="com.zhyc.module.produce.manage_sheep.add_sheep.mapper.ScAddSheepMapper">
|
||||||
|
|
||||||
|
<!-- 1. 结果映射:包含羊舍名称、品种名称 -->
|
||||||
<resultMap type="com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep" id="ScAddSheepResult">
|
<resultMap type="com.zhyc.module.produce.manage_sheep.add_sheep.domain.ScAddSheep" id="ScAddSheepResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="earNumber" column="ear_number"/>
|
<result property="earNumber" column="ear_number"/>
|
||||||
<result property="sheepfold" column="sheepfold"/>
|
<result property="sheepfold" column="sheepfold"/>
|
||||||
<result property="sheepfoldName" column="sheepfoldName"/>
|
<result property="sheepfoldName" column="sheepfoldName"/>
|
||||||
<result property="sheepfoldNameExcel" column="sheepfoldName"/>
|
<result property="father" column="father"/>
|
||||||
<result property="father" column="father"/>
|
<result property="mother" column="mother"/>
|
||||||
<result property="mother" column="mother"/>
|
<result property="bornWeight" column="born_weight"/>
|
||||||
<result property="bornWeight" column="born_weight"/>
|
<result property="birthday" column="birthday"/>
|
||||||
<result property="birthday" column="birthday"/>
|
<result property="gender" column="gender"/>
|
||||||
<result property="gender" column="gender"/>
|
<result property="parity" column="parity"/>
|
||||||
<result property="parity" column="parity"/>
|
<result property="varietyId" column="variety_id"/>
|
||||||
<result property="varietyId" column="variety_id"/>
|
<result property="varietyName" column="varietyName"/>
|
||||||
<result property="joinDate" column="join_date"/>
|
<result property="joinDate" column="join_date"/>
|
||||||
<result property="comment" column="comment"/>
|
<result property="comment" column="comment"/>
|
||||||
<result property="technician" column="technician"/>
|
<result property="technician" column="technician"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insert" parameterType="ScAddSheep" useGeneratedKeys="true" keyProperty="id">
|
<!-- 2. 查询列表:支持按品种筛选 -->
|
||||||
INSERT INTO sc_add_sheep
|
|
||||||
(ear_number, sheepfold, father, mother, born_weight, birthday, gender, parity,
|
|
||||||
variety_id, join_date, comment, technician, create_by, create_time)
|
|
||||||
VALUES (#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight}, #{birthday},
|
|
||||||
#{gender}, #{parity}, #{varietyId}, #{joinDate}, #{comment}, #{technician},
|
|
||||||
#{createBy}, #{createTime})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
|
<select id="selectScAddSheepList" parameterType="ScAddSheep" resultMap="ScAddSheepResult">
|
||||||
SELECT
|
SELECT
|
||||||
sas.*,
|
sas.*,
|
||||||
sf.sheepfold_name AS sheepfoldName
|
sf.sheepfold_name AS sheepfoldName,
|
||||||
|
bv.variety AS varietyName
|
||||||
FROM sc_add_sheep sas
|
FROM sc_add_sheep sas
|
||||||
LEFT JOIN da_sheepfold sf ON sas.sheepfold = sf.id
|
LEFT JOIN da_sheepfold sf ON sas.sheepfold = sf.id
|
||||||
|
LEFT JOIN bas_sheep_variety bv ON sas.variety_id = bv.id
|
||||||
<where>
|
<where>
|
||||||
<if test="earNumber != null and earNumber != ''">
|
<if test="earNumber != null and earNumber != ''">
|
||||||
AND sas.ear_number LIKE CONCAT('%', #{earNumber}, '%')
|
AND sas.ear_number LIKE CONCAT('%', #{earNumber}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="sheepfold != null">
|
||||||
|
AND sas.sheepfold = #{sheepfold}
|
||||||
|
</if>
|
||||||
|
<if test="varietyId != null">
|
||||||
|
AND sas.variety_id = #{varietyId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 3. 根据耳号精确查询 -->
|
||||||
|
<select id="selectByEarNumber" parameterType="string" resultMap="ScAddSheepResult">
|
||||||
|
SELECT * FROM sc_add_sheep WHERE ear_number = #{earNumber}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 4. 插入 -->
|
||||||
|
<insert id="insert" parameterType="ScAddSheep" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO sc_add_sheep
|
||||||
|
(ear_number, sheepfold, father, mother, born_weight, birthday,
|
||||||
|
gender, parity, variety_id, join_date, comment, technician,
|
||||||
|
create_by, create_time)
|
||||||
|
VALUES
|
||||||
|
(#{earNumber}, #{sheepfold}, #{father}, #{mother}, #{bornWeight},
|
||||||
|
#{birthday}, #{gender}, #{parity}, #{varietyId}, #{joinDate},
|
||||||
|
#{comment}, #{technician}, #{createBy}, #{createTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 5. 更新 -->
|
||||||
<update id="updateScAddSheep" parameterType="ScAddSheep">
|
<update id="updateScAddSheep" parameterType="ScAddSheep">
|
||||||
UPDATE sc_add_sheep
|
UPDATE sc_add_sheep
|
||||||
<set>
|
<set>
|
||||||
ear_number = #{earNumber},
|
ear_number = #{earNumber},
|
||||||
sheepfold = #{sheepfold},
|
sheepfold = #{sheepfold},
|
||||||
father = #{father},
|
father = #{father},
|
||||||
mother = #{mother},
|
mother = #{mother},
|
||||||
born_weight = #{bornWeight},
|
born_weight = #{bornWeight},
|
||||||
birthday = #{birthday},
|
birthday = #{birthday},
|
||||||
gender = #{gender},
|
gender = #{gender},
|
||||||
parity = #{parity},
|
parity = #{parity},
|
||||||
variety_id = #{varietyId},
|
variety_id = #{varietyId},
|
||||||
join_date = #{joinDate},
|
join_date = #{joinDate},
|
||||||
comment = #{comment},
|
comment = #{comment},
|
||||||
technician = #{technician},
|
technician = #{technician},
|
||||||
update_by = #{updateBy},
|
update_by = #{updateBy},
|
||||||
update_time = NOW()
|
update_time = NOW()
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 6. 批量删除 -->
|
||||||
<delete id="deleteScAddSheepByIds">
|
<delete id="deleteScAddSheepByIds">
|
||||||
DELETE FROM sc_add_sheep WHERE id IN
|
DELETE FROM sc_add_sheep WHERE id IN
|
||||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectByEarNumber" parameterType="string" resultMap="ScAddSheepResult">
|
|
||||||
SELECT * FROM sc_add_sheep WHERE ear_number = #{earNumber}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
@ -10,6 +10,8 @@
|
|||||||
<result property="foldTo" column="fold_to"/>
|
<result property="foldTo" column="fold_to"/>
|
||||||
<result property="foldFrom" column="fold_from"/>
|
<result property="foldFrom" column="fold_from"/>
|
||||||
<result property="reason" column="reason"/>
|
<result property="reason" column="reason"/>
|
||||||
|
<result property="varietyId" column="variety_id"/>
|
||||||
|
<result property="varietyName" column="varietyName"/>
|
||||||
<result property="technician" column="technician"/>
|
<result property="technician" column="technician"/>
|
||||||
<result property="status" column="status"/>
|
<result property="status" column="status"/>
|
||||||
<result property="comment" column="comment"/>
|
<result property="comment" column="comment"/>
|
||||||
@ -23,6 +25,8 @@
|
|||||||
tg.fold_to,
|
tg.fold_to,
|
||||||
tg.fold_from,
|
tg.fold_from,
|
||||||
tg.reason,
|
tg.reason,
|
||||||
|
tg.variety_id,
|
||||||
|
bv.variety AS varietyName,
|
||||||
tg.technician,
|
tg.technician,
|
||||||
tg.status,
|
tg.status,
|
||||||
tg.comment,
|
tg.comment,
|
||||||
@ -33,15 +37,17 @@
|
|||||||
FROM sc_trans_group tg
|
FROM sc_trans_group tg
|
||||||
LEFT JOIN da_sheepfold sf_from ON tg.fold_from = sf_from.id
|
LEFT JOIN da_sheepfold sf_from ON tg.fold_from = sf_from.id
|
||||||
LEFT JOIN da_sheepfold sf_to ON tg.fold_to = sf_to.id
|
LEFT JOIN da_sheepfold sf_to ON tg.fold_to = sf_to.id
|
||||||
|
LEFT JOIN bas_sheep_variety bv ON tg.variety_id = bv.id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectScTransGroupList" parameterType="ScTransGroup" resultMap="ScTransGroupResult">
|
<select id="selectScTransGroupList" parameterType="ScTransGroup" resultMap="ScTransGroupResult">
|
||||||
<include refid="selectScTransGroupVo"/>
|
<include refid="selectScTransGroupVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
|
<if test="sheepId != null">and sheep_id = #{sheepId}</if>
|
||||||
<if test="foldTo != null and foldTo != ''">and fold_to = #{foldTo}</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="foldFrom != null and foldFrom != ''">and fold_from = #{foldFrom}</if>
|
||||||
<if test="status != null ">and status = #{status}</if>
|
<if test="status != null">and status = #{status}</if>
|
||||||
|
<if test="varietyId != null">and tg.variety_id = #{varietyId}</if>
|
||||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||||||
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||||
</if>
|
</if>
|
||||||
@ -54,13 +60,15 @@
|
|||||||
where tg.id = #{id}
|
where tg.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertScTransGroup" parameterType="ScTransGroup" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertScTransGroup" parameterType="ScTransGroup"
|
||||||
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sc_trans_group
|
insert into sc_trans_group
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="sheepId != null">sheep_id,</if>
|
<if test="sheepId != null">sheep_id,</if>
|
||||||
<if test="foldTo != null and foldTo != ''">fold_to,</if>
|
<if test="foldTo != null and foldTo != ''">fold_to,</if>
|
||||||
<if test="foldFrom != null and foldFrom != ''">fold_from,</if>
|
<if test="foldFrom != null and foldFrom != ''">fold_from,</if>
|
||||||
<if test="reason != null and reason != ''">reason,</if>
|
<if test="varietyId != null">variety_id,</if>
|
||||||
|
<if test="reason != null">reason,</if>
|
||||||
<if test="technician != null and technician != ''">technician,</if>
|
<if test="technician != null and technician != ''">technician,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="comment != null">comment,</if>
|
<if test="comment != null">comment,</if>
|
||||||
@ -71,7 +79,8 @@
|
|||||||
<if test="sheepId != null">#{sheepId},</if>
|
<if test="sheepId != null">#{sheepId},</if>
|
||||||
<if test="foldTo != null and foldTo != ''">#{foldTo},</if>
|
<if test="foldTo != null and foldTo != ''">#{foldTo},</if>
|
||||||
<if test="foldFrom != null and foldFrom != ''">#{foldFrom},</if>
|
<if test="foldFrom != null and foldFrom != ''">#{foldFrom},</if>
|
||||||
<if test="reason != null and reason != ''">#{reason},</if>
|
<if test="varietyId != null">#{varietyId},</if>
|
||||||
|
<if test="reason != null">#{reason},</if>
|
||||||
<if test="technician != null and technician != ''">#{technician},</if>
|
<if test="technician != null and technician != ''">#{technician},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="comment != null">#{comment},</if>
|
<if test="comment != null">#{comment},</if>
|
||||||
@ -86,14 +95,15 @@
|
|||||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||||
<if test="foldTo != null and foldTo != ''">fold_to = #{foldTo},</if>
|
<if test="foldTo != null and foldTo != ''">fold_to = #{foldTo},</if>
|
||||||
<if test="foldFrom != null and foldFrom != ''">fold_from = #{foldFrom},</if>
|
<if test="foldFrom != null and foldFrom != ''">fold_from = #{foldFrom},</if>
|
||||||
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
<if test="varietyId != null">variety_id = #{varietyId},</if>
|
||||||
|
<if test="reason != null">reason = #{reason},</if>
|
||||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where sc_trans_group.id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteScTransGroupById" parameterType="Integer">
|
<delete id="deleteScTransGroupById" parameterType="Integer">
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<result property="sheepId" column="sheep_id"/>
|
<result property="sheepId" column="sheep_id"/>
|
||||||
<result property="sheepfold" column="sheepfold"/>
|
<result property="sheepfold" column="sheepfold"/>
|
||||||
<result property="comment" column="comment"/>
|
<result property="comment" column="comment"/>
|
||||||
|
<result property="varietyId" column="variety_id"/>
|
||||||
<result property="technician" column="technician"/>
|
<result property="technician" column="technician"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
@ -19,12 +20,15 @@
|
|||||||
sc.sheep_id,
|
sc.sheep_id,
|
||||||
sc.sheepfold,
|
sc.sheepfold,
|
||||||
sf.sheepfold_name as sheepfoldName,
|
sf.sheepfold_name as sheepfoldName,
|
||||||
|
sc.variety_id,
|
||||||
|
bv.variety as varietyName,
|
||||||
sc.comment,
|
sc.comment,
|
||||||
sc.technician,
|
sc.technician,
|
||||||
sc.create_by,
|
sc.create_by,
|
||||||
sc.create_time
|
sc.create_time
|
||||||
from sc_castrate sc
|
from sc_castrate sc
|
||||||
left join da_sheepfold sf on sc.sheepfold = sf.id
|
left join da_sheepfold sf on sc.sheepfold = sf.id
|
||||||
|
left join bas_sheep_variety bv on sc.variety_id = bv.id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
|
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
|
||||||
@ -32,10 +36,14 @@
|
|||||||
<where>
|
<where>
|
||||||
<if test="sheepId != null and sheepId != ''">and sheep_id like concat('%', #{sheepId}, '%')</if>
|
<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="sheepfold != null ">and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||||
|
<if test="varietyId != null">
|
||||||
|
and sc.variety_id = #{varietyId}
|
||||||
|
</if>
|
||||||
<if test="technician != null and technician != ''">and technician like concat('%', #{technician}, '%')</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 != ''">
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||||||
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -49,6 +57,7 @@
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="sheepId != null">sheep_id,</if>
|
<if test="sheepId != null">sheep_id,</if>
|
||||||
<if test="sheepfold != null">sheepfold,</if>
|
<if test="sheepfold != null">sheepfold,</if>
|
||||||
|
<if test="varietyId != null">variety_id,</if>
|
||||||
<if test="comment != null">comment,</if>
|
<if test="comment != null">comment,</if>
|
||||||
<if test="technician != null">technician,</if>
|
<if test="technician != null">technician,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
@ -57,6 +66,7 @@
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="sheepId != null">#{sheepId},</if>
|
<if test="sheepId != null">#{sheepId},</if>
|
||||||
<if test="sheepfold != null">#{sheepfold},</if>
|
<if test="sheepfold != null">#{sheepfold},</if>
|
||||||
|
<if test="varietyId != null">#{varietyId},</if>
|
||||||
<if test="comment != null">#{comment},</if>
|
<if test="comment != null">#{comment},</if>
|
||||||
<if test="technician != null">#{technician},</if>
|
<if test="technician != null">#{technician},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
@ -69,6 +79,7 @@
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||||
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
||||||
|
<if test="varietyId != null">variety_id = #{varietyId},</if>
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
<if test="technician != null">technician = #{technician},</if>
|
<if test="technician != null">technician = #{technician},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="manageTags" column="manageTags"/>
|
<result property="sheepId" column="sheep_id"/>
|
||||||
<result property="sheepfold" column="sheepfold"/>
|
<result property="sheepfold" column="sheepfold"/>
|
||||||
<result property="varietyId" column="variety_id"/>
|
|
||||||
<result property="sheepfoldName" column="sheepfoldName"/>
|
<result property="sheepfoldName" column="sheepfoldName"/>
|
||||||
<result property="comment" column="comment"/>
|
<result property="comment" column="comment"/>
|
||||||
<result property="technician" column="technician"/>
|
<result property="technician" column="technician"/>
|
||||||
@ -18,19 +17,15 @@
|
|||||||
|
|
||||||
<sql id="selectScFixHoofVo">
|
<sql id="selectScFixHoofVo">
|
||||||
select fh.id,
|
select fh.id,
|
||||||
bs.manage_tags AS manageTags,
|
fh.sheep_id,
|
||||||
fh.sheepfold,
|
fh.sheepfold,
|
||||||
sf.sheepfold_name AS sheepfoldName,
|
sf.sheepfold_name as sheepfoldName,
|
||||||
fh.variety_id,
|
|
||||||
bv.variety AS varietyName,
|
|
||||||
fh.comment,
|
fh.comment,
|
||||||
fh.technician,
|
fh.technician,
|
||||||
fh.create_by,
|
fh.create_by,
|
||||||
fh.create_time
|
fh.create_time
|
||||||
from sc_fix_hoof fh
|
from sc_fix_hoof fh
|
||||||
left join bas_sheep bs on fh.sheep_id = bs.id
|
|
||||||
left join da_sheepfold sf on fh.sheepfold = sf.id
|
left join da_sheepfold sf on fh.sheepfold = sf.id
|
||||||
left join bas_sheep_variety bv on fh.variety_id = bv.id
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
||||||
@ -38,15 +33,9 @@
|
|||||||
<where>
|
<where>
|
||||||
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
|
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
|
||||||
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
|
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
|
||||||
<if test="varietyId != null">
|
|
||||||
and fh.variety_id = #{varietyId}
|
|
||||||
</if>
|
|
||||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||||||
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="manageTags != null and manageTags != ''">
|
|
||||||
and bs.manage_tags like concat('%', #{manageTags}, '%')
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -55,24 +44,24 @@
|
|||||||
where fh.id = #{id}
|
where fh.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertScFixHoof" parameterType="ScFixHoof"
|
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
|
||||||
useGeneratedKeys="true" keyProperty="id">
|
insert into sc_fix_hoof
|
||||||
INSERT INTO sc_fix_hoof
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
(sheep_id,
|
<if test="sheepId != null and sheepId != ''">and fh.sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||||
sheepfold,
|
<if test="sheepfold != null">and fh.sheepfold = #{sheepfold}</if>
|
||||||
variety_id,
|
<if test="comment != null">comment,</if>
|
||||||
<if test="comment != null">comment,</if>
|
<if test="technician != null and technician != ''">technician,</if>
|
||||||
<if test="technician != null and technician != ''">technician,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
create_by,
|
<if test="createTime != null">create_time,</if>
|
||||||
create_time)
|
</trim>
|
||||||
VALUES
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
(#{sheepId},
|
<if test="sheepId != null">#{sheepId},</if>
|
||||||
#{sheepfold},
|
<if test="sheepfold != null">#{sheepfold},</if>
|
||||||
<if test="varietyId != null">#{varietyId},</if>
|
<if test="comment != null">#{comment},</if>
|
||||||
<if test="comment != null">#{comment},</if>
|
<if test="technician != null and technician != ''">#{technician},</if>
|
||||||
<if test="technician != null and technician != ''">#{technician},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
#{createBy},
|
<if test="createTime != null">#{createTime},</if>
|
||||||
#{createTime})
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
||||||
@ -80,7 +69,6 @@
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||||
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
||||||
<if test="varietyId != null">variety_id=#{varietyId},</if>
|
|
||||||
<if test="comment != null">comment = #{comment},</if>
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
@ -101,6 +89,4 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user