Compare commits
No commits in common. "898add567d3a7d406d16371a502f7a1451c5acff" and "e1dab0951242b19d044255966f9483eede14ac83" have entirely different histories.
898add567d
...
e1dab09512
@ -6,7 +6,6 @@ import com.zhyc.common.core.domain.AjaxResult;
|
|||||||
import com.zhyc.common.core.page.TableDataInfo;
|
import com.zhyc.common.core.page.TableDataInfo;
|
||||||
import com.zhyc.common.enums.BusinessType;
|
import com.zhyc.common.enums.BusinessType;
|
||||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||||
import com.zhyc.module.base.domain.BasSheep;
|
|
||||||
import com.zhyc.module.base.domain.SheepFile;
|
import com.zhyc.module.base.domain.SheepFile;
|
||||||
import com.zhyc.module.base.service.ISheepFileService;
|
import com.zhyc.module.base.service.ISheepFileService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -64,13 +63,36 @@ public class SheepFileController extends BaseController
|
|||||||
return success(sheepFileService.selectSheepFileById(id));
|
return success(sheepFileService.selectSheepFileById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* 根据耳号查询是否存在羊舍
|
* 新增羊只档案
|
||||||
* */
|
*/
|
||||||
@GetMapping("/byNo/{manageTags}")
|
@PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:add')")
|
||||||
public AjaxResult byManageTags(@PathVariable String manageTags){
|
@Log(title = "羊只档案", businessType = BusinessType.INSERT)
|
||||||
SheepFile sheep=sheepFileService.selectBasSheepByManageTags(manageTags.trim());
|
@PostMapping
|
||||||
return success(sheep);
|
public AjaxResult add(@RequestBody SheepFile sheepFile)
|
||||||
|
{
|
||||||
|
return toAjax(sheepFileService.insertSheepFile(sheepFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改羊只档案
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:edit')")
|
||||||
|
@Log(title = "羊只档案", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SheepFile sheepFile)
|
||||||
|
{
|
||||||
|
return toAjax(sheepFileService.updateSheepFile(sheepFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除羊只档案
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('sheep_file:sheep_file:remove')")
|
||||||
|
@Log(title = "羊只档案", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(sheepFileService.deleteSheepFileByIds(ids));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,12 +28,36 @@ public interface SheepFileMapper
|
|||||||
*/
|
*/
|
||||||
public List<SheepFile> selectSheepFileList(SheepFile sheepFile);
|
public List<SheepFile> selectSheepFileList(SheepFile sheepFile);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据管理耳号查询
|
* 新增羊只档案
|
||||||
*
|
*
|
||||||
* @param tags 管理耳号
|
* @param sheepFile 羊只档案
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
SheepFile selectSheepByManageTags(String tags);
|
public int insertSheepFile(SheepFile sheepFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改羊只档案
|
||||||
|
*
|
||||||
|
* @param sheepFile 羊只档案
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSheepFile(SheepFile sheepFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除羊只档案
|
||||||
|
*
|
||||||
|
* @param id 羊只档案主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSheepFileById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除羊只档案
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSheepFileByIds(Long[] ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,35 @@ public interface ISheepFileService
|
|||||||
*/
|
*/
|
||||||
public List<SheepFile> selectSheepFileList(SheepFile sheepFile);
|
public List<SheepFile> selectSheepFileList(SheepFile sheepFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增羊只档案
|
||||||
|
*
|
||||||
|
* @param sheepFile 羊只档案
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSheepFile(SheepFile sheepFile);
|
||||||
|
|
||||||
SheepFile selectBasSheepByManageTags(String trim);
|
/**
|
||||||
|
* 修改羊只档案
|
||||||
|
*
|
||||||
|
* @param sheepFile 羊只档案
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSheepFile(SheepFile sheepFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除羊只档案
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的羊只档案主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSheepFileByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除羊只档案信息
|
||||||
|
*
|
||||||
|
* @param id 羊只档案主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSheepFileById(Long id);
|
||||||
}
|
}
|
||||||
|
@ -16,35 +16,82 @@ import java.util.List;
|
|||||||
* @date 2025-07-13
|
* @date 2025-07-13
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SheepFileServiceImpl implements ISheepFileService {
|
public class SheepFileServiceImpl implements ISheepFileService
|
||||||
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private SheepFileMapper sheepFileMapper;
|
private SheepFileMapper sheepFileMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询羊只档案
|
* 查询羊只档案
|
||||||
*
|
*
|
||||||
* @param id 羊只档案主键
|
* @param id 羊只档案主键
|
||||||
* @return 羊只档案
|
* @return 羊只档案
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SheepFile selectSheepFileById(Long id) {
|
public SheepFile selectSheepFileById(Long id)
|
||||||
|
{
|
||||||
return sheepFileMapper.selectSheepFileById(id);
|
return sheepFileMapper.selectSheepFileById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询羊只档案列表
|
* 查询羊只档案列表
|
||||||
*
|
*
|
||||||
* @param sheepFile 羊只档案
|
* @param sheepFile 羊只档案
|
||||||
* @return 羊只档案
|
* @return 羊只档案
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SheepFile> selectSheepFileList(SheepFile sheepFile) {
|
public List<SheepFile> selectSheepFileList(SheepFile sheepFile)
|
||||||
|
{
|
||||||
return sheepFileMapper.selectSheepFileList(sheepFile);
|
return sheepFileMapper.selectSheepFileList(sheepFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增羊只档案
|
||||||
|
*
|
||||||
|
* @param sheepFile 羊只档案
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SheepFile selectBasSheepByManageTags(String tags) {
|
public int insertSheepFile(SheepFile sheepFile)
|
||||||
return sheepFileMapper.selectSheepByManageTags(tags);
|
{
|
||||||
|
sheepFile.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return sheepFileMapper.insertSheepFile(sheepFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改羊只档案
|
||||||
|
*
|
||||||
|
* @param sheepFile 羊只档案
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSheepFile(SheepFile sheepFile)
|
||||||
|
{
|
||||||
|
sheepFile.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return sheepFileMapper.updateSheepFile(sheepFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除羊只档案
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的羊只档案主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSheepFileByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return sheepFileMapper.deleteSheepFileByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除羊只档案信息
|
||||||
|
*
|
||||||
|
* @param id 羊只档案主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSheepFileById(Long id)
|
||||||
|
{
|
||||||
|
return sheepFileMapper.deleteSheepFileById(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import com.zhyc.common.core.page.TableDataInfo;
|
|||||||
* @date 2025-07-14
|
* @date 2025-07-14
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/biosafety/quarantine")
|
@RequestMapping("/bisosafety/quarantine")
|
||||||
public class QuarantineReportController extends BaseController
|
public class QuarantineReportController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -38,7 +38,7 @@ public class QuarantineReportController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询检疫记录列表
|
* 查询检疫记录列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:list')")
|
@PreAuthorize("@ss.hasPermi('bisosafety:quarantine:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(QuarantineReport quarantineReport)
|
public TableDataInfo list(QuarantineReport quarantineReport)
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ public class QuarantineReportController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出检疫记录列表
|
* 导出检疫记录列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:export')")
|
@PreAuthorize("@ss.hasPermi('bisosafety:quarantine:export')")
|
||||||
@Log(title = "检疫记录", businessType = BusinessType.EXPORT)
|
@Log(title = "检疫记录", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, QuarantineReport quarantineReport)
|
public void export(HttpServletResponse response, QuarantineReport quarantineReport)
|
||||||
@ -73,7 +73,7 @@ public class QuarantineReportController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增检疫记录
|
* 新增检疫记录
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:add')")
|
@PreAuthorize("@ss.hasPermi('bisosafety:quarantine:add')")
|
||||||
@Log(title = "检疫记录", businessType = BusinessType.INSERT)
|
@Log(title = "检疫记录", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody QuarantineReport quarantineReport)
|
public AjaxResult add(@RequestBody QuarantineReport quarantineReport)
|
||||||
@ -84,7 +84,7 @@ public class QuarantineReportController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改检疫记录
|
* 修改检疫记录
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:edit')")
|
@PreAuthorize("@ss.hasPermi('bisosafety:quarantine:edit')")
|
||||||
@Log(title = "检疫记录", businessType = BusinessType.UPDATE)
|
@Log(title = "检疫记录", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody QuarantineReport quarantineReport)
|
public AjaxResult edit(@RequestBody QuarantineReport quarantineReport)
|
||||||
@ -95,7 +95,7 @@ public class QuarantineReportController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除检疫记录
|
* 删除检疫记录
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:quarantine:remove')")
|
@PreAuthorize("@ss.hasPermi('bisosafety:quarantine:remove')")
|
||||||
@Log(title = "检疫记录", businessType = BusinessType.DELETE)
|
@Log(title = "检疫记录", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
@ -65,7 +65,7 @@ public class SwMedicineUsageController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biosafety:usageInfo:query')")
|
@PreAuthorize("@ss.hasPermi('biosafety:usageInfo:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
return success(swMedicineUsageService.selectSwMedicineUsageById(id));
|
return success(swMedicineUsageService.selectSwMedicineUsageById(id));
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.zhyc.module.biosafety.domain;
|
package com.zhyc.module.biosafety.domain;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
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;
|
||||||
@ -14,13 +12,12 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
* @date 2025-07-12
|
* @date 2025-07-12
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
public class SwMedicineUsage extends BaseEntity
|
public class SwMedicineUsage extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/** 使用名称 */
|
/** 使用名称 */
|
||||||
@Excel(name = "使用名称")
|
@Excel(name = "使用名称")
|
||||||
@ -33,5 +30,57 @@ public class SwMedicineUsage extends BaseEntity
|
|||||||
/** 药品使用记录详情信息 */
|
/** 药品使用记录详情信息 */
|
||||||
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;
|
private List<SwMedicineUsageDetails> swMedicineUsageDetailsList;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseType(String useType)
|
||||||
|
{
|
||||||
|
this.useType = useType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUseType()
|
||||||
|
{
|
||||||
|
return useType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SwMedicineUsageDetails> getSwMedicineUsageDetailsList()
|
||||||
|
{
|
||||||
|
return swMedicineUsageDetailsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSwMedicineUsageDetailsList(List<SwMedicineUsageDetails> swMedicineUsageDetailsList)
|
||||||
|
{
|
||||||
|
this.swMedicineUsageDetailsList = swMedicineUsageDetailsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("useType", getUseType())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("swMedicineUsageDetailsList", getSwMedicineUsageDetailsList())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class SwMedicineUsageDetails extends BaseEntity
|
|||||||
|
|
||||||
/** 药品使用记录id */
|
/** 药品使用记录id */
|
||||||
@Excel(name = "药品使用记录id")
|
@Excel(name = "药品使用记录id")
|
||||||
private Integer mediUsage;
|
private Long mediUsage;
|
||||||
|
|
||||||
/** 药品id */
|
/** 药品id */
|
||||||
@Excel(name = "药品id")
|
@Excel(name = "药品id")
|
||||||
|
@ -22,6 +22,7 @@ public class Treatment extends BaseEntity
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 诊疗记录id */
|
/** 诊疗记录id */
|
||||||
@ -29,11 +30,7 @@ public class Treatment extends BaseEntity
|
|||||||
|
|
||||||
/** 羊只耳号 */
|
/** 羊只耳号 */
|
||||||
@Excel(name = "羊只耳号")
|
@Excel(name = "羊只耳号")
|
||||||
private String sheepNo;
|
|
||||||
|
|
||||||
private Long sheepId;
|
private Long sheepId;
|
||||||
// 用于批量新增
|
|
||||||
private List<String> sheepIds;
|
|
||||||
|
|
||||||
/** 品种 */
|
/** 品种 */
|
||||||
@Excel(name = "品种")
|
@Excel(name = "品种")
|
||||||
@ -74,14 +71,11 @@ public class Treatment extends BaseEntity
|
|||||||
|
|
||||||
/** 疾病类型 */
|
/** 疾病类型 */
|
||||||
@Excel(name = "疾病类型")
|
@Excel(name = "疾病类型")
|
||||||
private String diseaseName;
|
|
||||||
|
|
||||||
private Long diseaseId;
|
private Long diseaseId;
|
||||||
|
|
||||||
|
|
||||||
/** 父疾病 */
|
/** 父疾病 */
|
||||||
@Excel(name = "父疾病")
|
@Excel(name = "父疾病")
|
||||||
private Long diseasePid;
|
private String diseasePid;
|
||||||
|
|
||||||
/** 兽医 */
|
/** 兽医 */
|
||||||
@Excel(name = "兽医")
|
@Excel(name = "兽医")
|
||||||
@ -89,7 +83,7 @@ public class Treatment extends BaseEntity
|
|||||||
|
|
||||||
/** 药品使用记录id */
|
/** 药品使用记录id */
|
||||||
@Excel(name = "药品使用记录id")
|
@Excel(name = "药品使用记录id")
|
||||||
private Integer usageId;
|
private Long usageId;
|
||||||
|
|
||||||
// 药品使用
|
// 药品使用
|
||||||
private List<SwMedicineUsageDetails> usageDetails;
|
private List<SwMedicineUsageDetails> usageDetails;
|
||||||
|
@ -19,7 +19,7 @@ public interface SwMedicineUsageMapper
|
|||||||
* @param id 药品使用记录主键
|
* @param id 药品使用记录主键
|
||||||
* @return 药品使用记录
|
* @return 药品使用记录
|
||||||
*/
|
*/
|
||||||
public SwMedicineUsage selectSwMedicineUsageById(Integer id);
|
public SwMedicineUsage selectSwMedicineUsageById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询药品使用记录列表
|
* 查询药品使用记录列表
|
||||||
@ -51,7 +51,7 @@ public interface SwMedicineUsageMapper
|
|||||||
* @param id 药品使用记录主键
|
* @param id 药品使用记录主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteSwMedicineUsageById(Integer id);
|
public int deleteSwMedicineUsageById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除药品使用记录
|
* 批量删除药品使用记录
|
||||||
@ -84,5 +84,5 @@ public interface SwMedicineUsageMapper
|
|||||||
* @param id 药品使用记录ID
|
* @param id 药品使用记录ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteSwMedicineUsageDetailsByMediUsage(Integer id);
|
public int deleteSwMedicineUsageDetailsByMediUsage(Long id);
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,4 @@ public interface TreatmentMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTreatmentByIds(Long[] ids);
|
public int deleteTreatmentByIds(Long[] ids);
|
||||||
|
|
||||||
int insertTreatmentList(List<Treatment> treatments);
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public interface ISwMedicineUsageService
|
|||||||
* @param id 药品使用记录主键
|
* @param id 药品使用记录主键
|
||||||
* @return 药品使用记录
|
* @return 药品使用记录
|
||||||
*/
|
*/
|
||||||
public SwMedicineUsage selectSwMedicineUsageById(Integer id);
|
public SwMedicineUsage selectSwMedicineUsageById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询药品使用记录列表
|
* 查询药品使用记录列表
|
||||||
@ -57,5 +57,5 @@ public interface ISwMedicineUsageService
|
|||||||
* @param id 药品使用记录主键
|
* @param id 药品使用记录主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteSwMedicineUsageById(Integer id);
|
public int deleteSwMedicineUsageById(Long id);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package com.zhyc.module.biosafety.service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.zhyc.module.biosafety.domain.Treatment;
|
import com.zhyc.module.biosafety.domain.Treatment;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 治疗记录Service接口
|
* 治疗记录Service接口
|
||||||
@ -37,7 +36,6 @@ public interface ITreatmentService
|
|||||||
*/
|
*/
|
||||||
public int insertTreatment(Treatment treatment);
|
public int insertTreatment(Treatment treatment);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改治疗记录
|
* 修改治疗记录
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
|||||||
* @return 药品使用记录
|
* @return 药品使用记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SwMedicineUsage selectSwMedicineUsageById(Integer id)
|
public SwMedicineUsage selectSwMedicineUsageById(Long id)
|
||||||
{
|
{
|
||||||
return swMedicineUsageMapper.selectSwMedicineUsageById(id);
|
return swMedicineUsageMapper.selectSwMedicineUsageById(id);
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
|||||||
swMedicineUsage.setCreateTime(DateUtils.getNowDate());
|
swMedicineUsage.setCreateTime(DateUtils.getNowDate());
|
||||||
int rows = swMedicineUsageMapper.insertSwMedicineUsage(swMedicineUsage);
|
int rows = swMedicineUsageMapper.insertSwMedicineUsage(swMedicineUsage);
|
||||||
insertSwMedicineUsageDetails(swMedicineUsage);
|
insertSwMedicineUsageDetails(swMedicineUsage);
|
||||||
return swMedicineUsage.getId();
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,7 +102,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
|||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int deleteSwMedicineUsageById(Integer id)
|
public int deleteSwMedicineUsageById(Long id)
|
||||||
{
|
{
|
||||||
swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(id);
|
swMedicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(id);
|
||||||
return swMedicineUsageMapper.deleteSwMedicineUsageById(id);
|
return swMedicineUsageMapper.deleteSwMedicineUsageById(id);
|
||||||
@ -116,7 +116,7 @@ public class SwMedicineUsageServiceImpl implements ISwMedicineUsageService
|
|||||||
public void insertSwMedicineUsageDetails(SwMedicineUsage swMedicineUsage)
|
public void insertSwMedicineUsageDetails(SwMedicineUsage swMedicineUsage)
|
||||||
{
|
{
|
||||||
List<SwMedicineUsageDetails> swMedicineUsageDetailsList = swMedicineUsage.getSwMedicineUsageDetailsList();
|
List<SwMedicineUsageDetails> swMedicineUsageDetailsList = swMedicineUsage.getSwMedicineUsageDetailsList();
|
||||||
Integer id = swMedicineUsage.getId();
|
Long id = swMedicineUsage.getId();
|
||||||
if (StringUtils.isNotNull(swMedicineUsageDetailsList))
|
if (StringUtils.isNotNull(swMedicineUsageDetailsList))
|
||||||
{
|
{
|
||||||
List<SwMedicineUsageDetails> list = new ArrayList<SwMedicineUsageDetails>();
|
List<SwMedicineUsageDetails> list = new ArrayList<SwMedicineUsageDetails>();
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
package com.zhyc.module.biosafety.service.impl;
|
package com.zhyc.module.biosafety.service.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.zhyc.common.utils.DateUtils;
|
import com.zhyc.common.utils.DateUtils;
|
||||||
import com.zhyc.common.utils.bean.BeanUtils;
|
|
||||||
import com.zhyc.module.base.domain.SheepFile;
|
|
||||||
import com.zhyc.module.base.mapper.SheepFileMapper;
|
|
||||||
import com.zhyc.module.base.service.impl.SheepFileServiceImpl;
|
|
||||||
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
import com.zhyc.module.biosafety.domain.SwMedicineUsage;
|
||||||
import com.zhyc.module.biosafety.domain.SwMedicineUsageDetails;
|
import com.zhyc.module.biosafety.domain.SwPrescription;
|
||||||
import com.zhyc.module.biosafety.mapper.SwMedicineUsageMapper;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.zhyc.module.biosafety.mapper.TreatmentMapper;
|
import com.zhyc.module.biosafety.mapper.TreatmentMapper;
|
||||||
@ -30,10 +24,6 @@ public class TreatmentServiceImpl implements ITreatmentService
|
|||||||
private TreatmentMapper treatmentMapper;
|
private TreatmentMapper treatmentMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SwMedicineUsageServiceImpl medicineUsageService;
|
private SwMedicineUsageServiceImpl medicineUsageService;
|
||||||
@Autowired
|
|
||||||
private SwMedicineUsageMapper medicineUsageMapper;
|
|
||||||
@Autowired
|
|
||||||
private SheepFileMapper sheepFileMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询治疗记录
|
* 查询治疗记录
|
||||||
@ -44,11 +34,7 @@ public class TreatmentServiceImpl implements ITreatmentService
|
|||||||
@Override
|
@Override
|
||||||
public Treatment selectTreatmentById(Long id)
|
public Treatment selectTreatmentById(Long id)
|
||||||
{
|
{
|
||||||
Treatment treatment = treatmentMapper.selectTreatmentById(id);
|
return treatmentMapper.selectTreatmentById(id);
|
||||||
// 获取药品使用记录
|
|
||||||
SwMedicineUsage swMedicineUsage = medicineUsageService.selectSwMedicineUsageById(treatment.getUsageId());
|
|
||||||
treatment.setUsageDetails(swMedicineUsage.getSwMedicineUsageDetailsList());
|
|
||||||
return treatment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,53 +59,14 @@ public class TreatmentServiceImpl implements ITreatmentService
|
|||||||
@Transactional
|
@Transactional
|
||||||
public int insertTreatment(Treatment treatment)
|
public int insertTreatment(Treatment treatment)
|
||||||
{
|
{
|
||||||
// 使用记录的文件
|
|
||||||
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
SwMedicineUsage medicineUsage = new SwMedicineUsage();
|
||||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
|
||||||
medicineUsage.setName("羊只治疗");
|
medicineUsage.setName("羊只治疗");
|
||||||
medicineUsage.setUseType("4");
|
medicineUsage.setUseType("4");
|
||||||
|
|
||||||
// 新增单挑数据
|
|
||||||
if (treatment.getSheepId()!=null){
|
|
||||||
// 药品使用记录
|
// 药品使用记录
|
||||||
Integer id=medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
||||||
// 药品使用记录id
|
medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
||||||
treatment.setUsageId(id);
|
treatment.setCreateTime(DateUtils.getNowDate());
|
||||||
treatment.setCreateTime(DateUtils.getNowDate());
|
return treatmentMapper.insertTreatment(treatment);
|
||||||
return treatmentMapper.insertTreatment(treatment);
|
|
||||||
|
|
||||||
// 批量新增
|
|
||||||
}else {
|
|
||||||
|
|
||||||
List<Treatment> treatments = new ArrayList<>();
|
|
||||||
treatment.setCreateTime(DateUtils.getNowDate());
|
|
||||||
for (String sheepId : treatment.getSheepIds()) {
|
|
||||||
SheepFile sheepFile = sheepFileMapper.selectSheepFileById(Long.valueOf(sheepId));
|
|
||||||
Treatment treat = new Treatment();
|
|
||||||
BeanUtils.copyProperties(treatment, treat);
|
|
||||||
treat.setSheepId(Long.valueOf(sheepId));
|
|
||||||
treat.setVariety(sheepFile.getVariety());
|
|
||||||
treat.setSheepType(sheepFile.getName());
|
|
||||||
treat.setMonthAge(sheepFile.getMonthAge());
|
|
||||||
treat.setGender(String.valueOf(sheepFile.getGender()));
|
|
||||||
treat.setBreed(sheepFile.getBreed());
|
|
||||||
treat.setParity(sheepFile.getParity());
|
|
||||||
treat.setLactDay(sheepFile.getLactationDay());
|
|
||||||
treat.setGestDay(sheepFile.getGestationDay());
|
|
||||||
// 获取药品使用记录的id
|
|
||||||
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);
|
|
||||||
System.out.println(medicineUsage);
|
|
||||||
System.out.println(usageId);
|
|
||||||
treat.setUsageId(usageId);
|
|
||||||
treatments.add(treat);
|
|
||||||
}
|
|
||||||
// 药品使用记录
|
|
||||||
medicineUsage.setSwMedicineUsageDetailsList(treatment.getUsageDetails());
|
|
||||||
|
|
||||||
|
|
||||||
return treatmentMapper.insertTreatmentList(treatments);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,11 +78,6 @@ public class TreatmentServiceImpl implements ITreatmentService
|
|||||||
@Override
|
@Override
|
||||||
public int updateTreatment(Treatment treatment)
|
public int updateTreatment(Treatment treatment)
|
||||||
{
|
{
|
||||||
for (SwMedicineUsageDetails usageDetail : treatment.getUsageDetails()) {
|
|
||||||
usageDetail.setMediUsage(treatment.getUsageId());
|
|
||||||
}
|
|
||||||
medicineUsageMapper.deleteSwMedicineUsageDetailsByMediUsage(treatment.getUsageId());
|
|
||||||
medicineUsageMapper.batchSwMedicineUsageDetails(treatment.getUsageDetails());
|
|
||||||
treatment.setUpdateTime(DateUtils.getNowDate());
|
treatment.setUpdateTime(DateUtils.getNowDate());
|
||||||
return treatmentMapper.updateTreatment(treatment);
|
return treatmentMapper.updateTreatment(treatment);
|
||||||
}
|
}
|
||||||
|
@ -94,10 +94,223 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectSheepFileVo"/>
|
<include refid="selectSheepFileVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSheepByManageTags" parameterType="String" resultMap="SheepFileResult">
|
|
||||||
<include refid="selectSheepFileVo"/>
|
<insert id="insertSheepFile" parameterType="SheepFile">
|
||||||
where bs_manage_tags = #{tags}
|
insert into sheep_file
|
||||||
</select>
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<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="name != null">name,</if>
|
||||||
|
<if test="gender != null">gender,</if>
|
||||||
|
<if test="birthday != null">birthday,</if>
|
||||||
|
<if test="dayAge != null">day_age,</if>
|
||||||
|
<if test="monthAge != null">month_age,</if>
|
||||||
|
<if test="parity != null">parity,</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="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="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="sourceDate != null">source_date,</if>
|
||||||
|
<if test="sourceRanchId != null">source_ranch_id,</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>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="isDelete != null">is_delete,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<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="name != null">#{name},</if>
|
||||||
|
<if test="gender != null">#{gender},</if>
|
||||||
|
<if test="birthday != null">#{birthday},</if>
|
||||||
|
<if test="dayAge != null">#{dayAge},</if>
|
||||||
|
<if test="monthAge != null">#{monthAge},</if>
|
||||||
|
<if test="parity != null">#{parity},</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="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="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="sourceDate != null">#{sourceDate},</if>
|
||||||
|
<if test="sourceRanchId != null">#{sourceRanchId},</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>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="isDelete != null">#{isDelete},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSheepFile" parameterType="SheepFile">
|
||||||
|
update sheep_file
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<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="name != null">name = #{name},</if>
|
||||||
|
<if test="gender != null">gender = #{gender},</if>
|
||||||
|
<if test="birthday != null">birthday = #{birthday},</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="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="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="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="sourceDate != null">source_date = #{sourceDate},</if>
|
||||||
|
<if test="sourceRanchId != null">source_ranch_id = #{sourceRanchId},</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>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSheepFileById" parameterType="Long">
|
||||||
|
delete from sheep_file where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSheepFileByIds" parameterType="String">
|
||||||
|
delete from sheep_file where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSwMedicineUsageById" parameterType="Integer" resultMap="SwMedicineUsageSwMedicineUsageDetailsResult">
|
<select id="selectSwMedicineUsageById" parameterType="Long" resultMap="SwMedicineUsageSwMedicineUsageDetailsResult">
|
||||||
select id, name, use_type, update_by, update_time, create_by, create_time
|
select id, name, use_type, update_by, update_time, create_by, create_time
|
||||||
from sw_medicine_usage
|
from sw_medicine_usage
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSwMedicineUsageDetailsByMediUsage" parameterType="Integer">
|
<delete id="deleteSwMedicineUsageDetailsByMediUsage" parameterType="Long">
|
||||||
delete from sw_medicine_usage_details where medi_usage = #{mediUsage}
|
delete from sw_medicine_usage_details where medi_usage = #{mediUsage}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="diagId" column="diag_id" />
|
<result property="diagId" column="diag_id" />
|
||||||
<result property="sheepId" column="sheep_id" />
|
<result property="sheepId" column="sheep_id" />
|
||||||
<result property="sheepNo" column="manage_tags"/>
|
|
||||||
<result property="variety" column="variety" />
|
<result property="variety" column="variety" />
|
||||||
<result property="sheepType" column="sheep_type" />
|
<result property="sheepType" column="sheep_type" />
|
||||||
<result property="monthAge" column="month_age" />
|
<result property="monthAge" column="month_age" />
|
||||||
@ -19,7 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="gestDay" column="gest_day" />
|
<result property="gestDay" column="gest_day" />
|
||||||
<result property="datetime" column="datetime" />
|
<result property="datetime" column="datetime" />
|
||||||
<result property="diseaseId" column="disease_id" />
|
<result property="diseaseId" column="disease_id" />
|
||||||
<result property="diseaseName" column="disease_name"/>
|
|
||||||
<result property="diseasePid" column="disease_pid" />
|
<result property="diseasePid" column="disease_pid" />
|
||||||
<result property="veterinary" column="veterinary" />
|
<result property="veterinary" column="veterinary" />
|
||||||
<result property="usageId" column="usage_id" />
|
<result property="usageId" column="usage_id" />
|
||||||
@ -31,12 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectTreatmentVo">
|
<sql id="selectTreatmentVo">
|
||||||
select t.id, diag_id, sheep_id, variety, sheep_type, month_age, t.gender, t.parity, breed, lact_day, gest_day, datetime, disease_id, disease_pid, veterinary, usage_id, t.comment, t.update_by, t.update_time, t.create_by, t.create_time,
|
select id, diag_id, sheep_id, variety, sheep_type, month_age, gender, parity, breed, lact_day, gest_day, datetime, disease_id, disease_pid, veterinary, usage_id, comment, update_by, update_time, create_by, create_time from sw_treatment
|
||||||
bs.manage_tags,
|
|
||||||
sd.name disease_name
|
|
||||||
from sw_treatment t
|
|
||||||
left join bas_sheep bs on t.sheep_id = bs.id
|
|
||||||
left join sw_disease sd on t.disease_id = sd.id
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectTreatmentList" parameterType="Treatment" resultMap="TreatmentResult">
|
<select id="selectTreatmentList" parameterType="Treatment" resultMap="TreatmentResult">
|
||||||
@ -51,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectTreatmentById" parameterType="Long" resultMap="TreatmentResult">
|
<select id="selectTreatmentById" parameterType="Long" resultMap="TreatmentResult">
|
||||||
<include refid="selectTreatmentVo"/>
|
<include refid="selectTreatmentVo"/>
|
||||||
where t.id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertTreatment" parameterType="Treatment" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTreatment" parameterType="Treatment" useGeneratedKeys="true" keyProperty="id">
|
||||||
@ -102,22 +95,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertTreatmentList" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
|
||||||
insert into sw_treatment
|
|
||||||
(diag_id, sheep_id, variety, sheep_type, month_age, gender,
|
|
||||||
parity, breed, lact_day, gest_day, datetime,
|
|
||||||
disease_id, disease_pid, veterinary, usage_id,
|
|
||||||
comment, update_by, update_time, create_by, create_time)
|
|
||||||
values
|
|
||||||
<foreach collection="list" item="t" separator=",">
|
|
||||||
(#{t.diagId}, #{t.sheepId}, #{t.variety}, #{t.sheepType},
|
|
||||||
#{t.monthAge}, #{t.gender}, #{t.parity}, #{t.breed},
|
|
||||||
#{t.lactDay}, #{t.gestDay}, #{t.datetime}, #{t.diseaseId},
|
|
||||||
#{t.diseasePid}, #{t.veterinary},#{t.usageId}, #{t.comment},
|
|
||||||
#{t.updateBy}, #{t.updateTime},#{t.createBy}, #{t.createTime})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateTreatment" parameterType="Treatment">
|
<update id="updateTreatment" parameterType="Treatment">
|
||||||
update sw_treatment
|
update sw_treatment
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user