| | |
| | | import com.ld.igds.check.dto.CheckItemData; |
| | | import com.ld.igds.check.dto.CheckStandardData; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据化验结果更新值,如果已经有值则不更新,避免覆盖人工录入信息 |
| | | * |
| | | * @param item |
| | | * @return |
| | | */ |
| | |
| | | */ |
| | | List<CheckItemData> getCheckItemById(@Param("checkId") String checkId, |
| | | @Param("companyId") String companyId); |
| | | |
| | | /** |
| | | * 获取配置的化验项信息 |
| | | * |
| | |
| | | List<CheckStandardData> getCheckStandard(@Param("companyId") String companyId, |
| | | @Param("foodVariety") String foodVariety); |
| | | |
| | | /** |
| | | * 根据条件删除化验项 |
| | | * |
| | | * @param item |
| | | * @return |
| | | */ |
| | | int delCheckItemByParam(@Param("data") CheckItemData item); |
| | | |
| | | } |
| | |
| | | import com.bstek.bdf2.core.orm.hibernate.HibernateDao; |
| | | import com.bstek.dorado.data.entity.EntityUtils; |
| | | import com.bstek.dorado.data.provider.Page; |
| | | import com.ld.igds.check.dto.CheckItemData; |
| | | import com.ld.igds.check.mapper.CheckStandardMapper; |
| | | import com.ld.igds.constant.RedisConst; |
| | | import com.ld.igds.models.MQuality; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author chen |
| | |
| | | if (null == data.getDeptId()) { |
| | | data.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (null != data.getZblb() || "" != data.getZblb()) { |
| | | String[] str = data.getZblb().split("#"); |
| | | //防止在更新操作时再次存入相同的数据 |
| | | Set<String> metrics = new HashSet<>(); |
| | | for (int i = 0; i < str.length; i++) { |
| | | metrics.add(str[i].substring(0, 1)); |
| | | } |
| | | String value = ""; |
| | | for (String s : metrics) { |
| | | value = value + s + "#"; |
| | | } |
| | | data.setZblb(value.substring(0, value.length() - 1)); |
| | | } |
| | | Session session = this.getSessionFactory().openSession(); |
| | | data.setUpdateTime(new Date()); |
| | | try { |
| | |
| | | try { |
| | | if (null != data.getId()) { |
| | | session.delete(data); |
| | | CheckItemData checkItemData = new CheckItemData(); |
| | | checkItemData.setCompanyId(ContextUtil.getCompanyId()); |
| | | checkItemData.setCheckId(data.getId()); |
| | | checkStandardMapper.delCheckItemByParam(checkItemData); |
| | | redisUtil.del(RedisConst.buildKey(ContextUtil.getCompanyId(), RedisConst.KEY_DEPOT_QUALITY, data.getDepotId())); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | <PropertyDef name="remark"> |
| | | <Property name="label">备注信息</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="storeDate"> |
| | | <Property name="dataType">Date</Property> |
| | | <Property name="label">入库日期</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="unit"> |
| | | <Property/> |
| | | <Property name="label">检验单位</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="zblb"> |
| | | <Property/> |
| | | <Property name="label">指标类别</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="qfrq"> |
| | | <Property name="dataType">Date</Property> |
| | | <Property name="label">签发日期</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="bgcjsj"> |
| | | <Property name="dataType">Date</Property> |
| | | <Property name="label">报告出具时间</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="shrxm"> |
| | | <Property/> |
| | | <Property name="label">审核人姓名</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="qydbh"> |
| | | <Property/> |
| | | <Property name="label">扦样单编号</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="jdrxm"> |
| | | <Property/> |
| | | <Property name="label">监督人姓名</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ypbh"> |
| | | <Property/> |
| | | <Property name="label">样品编号</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="updateTime"> |
| | | <Property name="dataType">Date</Property> |
| | | <Property name="label">数据更新时间</Property> |
| | | </PropertyDef> |
| | | <Reference name="checkItems"> |
| | | <Property name="dataProvider">checkStandardPR#listCheckItemsByParam</Property> |
| | | <Property name="dataType">[dtCheckItems]</Property> |
| | |
| | | <Property name="label">化验结果</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="operaSymbolValue"> |
| | | <Property/> |
| | | <Property></Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="operaSymbol"> |
| | | <Property/> |
| | | <Property></Property> |
| | | <Property name="label">运算符号</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ruleNum"> |
| | |
| | | <Property name="label">扣价</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="result"> |
| | | <Property/> |
| | | <Property></Property> |
| | | <Property name="label">检验结果</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("inoutDataPR#triggerResult").getResult()}</Property> |
| | |
| | | <Property name="dataType">String</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | <DataType name="dtMetrics"> |
| | | <PropertyDef name="code"/> |
| | | <PropertyDef name="name"/> |
| | | </DataType> |
| | | <DataType name="dtResult"> |
| | | <PropertyDef name="name"/> |
| | | </DataType> |
| | | </Model> |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <ClientEvent name="onReady">var deptId = window.parent.DEPT_ID;//父页面中的分库编码
 |
| | |
| | | <Property name="dataType">[dataTypeUser]</Property> |
| | | <Property name="pageSize">100</Property> |
| | | <Property name="dataProvider">bdf2.userMaintain#loadUsers</Property> |
| | | </DataSet> |
| | | <DataSet id="dsMetrics"> |
| | | <ClientEvent name="onCreate">var data = [ {
 |
| | | name : "1:质量指标检验"
 |
| | | }, {
 |
| | | name : "2:储存品质检验"
 |
| | | }, {
 |
| | | name : "3:食品安全检验"
 |
| | | }]
 |
| | | self.setData(data);
 |
| | | </ClientEvent> |
| | | <Property name="dataType">[dtMetrics]</Property> |
| | | </DataSet> |
| | | <DataSet id="dsResult"> |
| | | <ClientEvent name="onCreate">var data = [ {
 |
| | | name : "达标"
 |
| | | }, {
 |
| | | name : "不达标"
 |
| | | }, {
 |
| | | name : "宜存"
 |
| | | },{
 |
| | | name : "轻度不宜存"
 |
| | | },{
 |
| | | name : "重度不宜存"
 |
| | | }, {
 |
| | | name : "合格"
 |
| | | }, {
 |
| | | name : "不合格"
 |
| | | }]
 |
| | | self.setData(data);
 |
| | | </ClientEvent> |
| | | <Property name="dataType">[dtResult]</Property> |
| | | </DataSet> |
| | | <Container layout="regionPadding:10" layoutConstraint="top"> |
| | | <Property name="exClassName">bg-color</Property> |
| | |
| | | <Property name="name">foodVariety</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <Property name="property">foodType</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="name">foodType</Property> |
| | | </DataColumn> |
| | | <DataColumn> |
| | | <Property name="property">foodLevel</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="name">foodLevel</Property> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">foodType</Property> |
| | | <Property name="property">foodType</Property> |
| | | <Property name="name">foodLevel</Property> |
| | | <Property name="property">foodLevel</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">foodLevel</Property> |
| | | <Property name="property">foodLevel</Property> |
| | | <Property name="name">unit</Property> |
| | | <Property name="property">unit</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">foodLocation</Property> |
| | | <Property name="property">foodLocation</Property> |
| | | <Property name="trigger">ddFoodOrigin</Property> |
| | | <Property name="name">shrxm</Property> |
| | | <Property name="property">shrxm</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | </Editor> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">zblb</Property> |
| | | <Property name="property">zblb</Property> |
| | | <Editor> |
| | | <TagEditor> |
| | | <Property name="textSeperator">#</Property> |
| | | <Property name="availableTagsDataSet">dsMetrics</Property> |
| | | <Property name="availableTagsDataPath">.name</Property> |
| | | </TagEditor> |
| | | </Editor> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:1"> |
| | | <Property name="name">result</Property> |
| | | <Property name="property">result</Property> |
| | | <Editor/> |
| | | <Editor> |
| | | <TagEditor> |
| | | <Property name="availableTagsDataPath">.name</Property> |
| | | <Property name="availableTagsDataSet">dsResult</Property> |
| | | <Property name="textSeperator">#</Property> |
| | | </TagEditor> |
| | | </Editor> |
| | | </AutoFormElement> |
| | | <Label layoutConstraint="colSpan:2"> |
| | | <Property name="text">说明:多项指标时按照1:质量指标检验(达标,不达标)、2:储存品质检验(宜存,不宜存)、3:食品安全检验(合格,不合格)这个顺序填写检验结论</Property> |
| | | <Property name="style"> |
| | | <Property name="color">blue</Property> |
| | | </Property> |
| | | </Label> |
| | | <AutoFormElement layoutConstraint="colSpan:3"> |
| | | <Property name="name">remark</Property> |
| | | <Property name="property">remark</Property> |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 质量追溯管理 |
| | | * |
| | | * @author: chen |
| | | * |
| | | * @author: chen |
| | | */ |
| | | @Component |
| | | public class QualityManagerPR { |
| | |
| | | |
| | | /** |
| | | * 检验类别 |
| | | * |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerType").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | // @DataProvider |
| | | // public List<DicTrigger> triggerType() { |
| | | // List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | // list.add(new DicTrigger("01", "满仓初检")); |
| | | // list.add(new DicTrigger("02", "出仓检验")); |
| | | // list.add(new DicTrigger("03", "月度普检")); |
| | | // return list; |
| | | // } |
| | | @DataProvider |
| | | public List<DicTrigger> triggerType() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | list.add(new DicTrigger("01", "满仓初检")); |
| | | list.add(new DicTrigger("01", "入仓验收")); |
| | | list.add(new DicTrigger("02", "出仓检验")); |
| | | list.add(new DicTrigger("03", "月度普检")); |
| | | list.add(new DicTrigger("03", "3月末普检")); |
| | | list.add(new DicTrigger("04", "9月末普检")); |
| | | list.add(new DicTrigger("05", "入库初检")); |
| | | list.add(new DicTrigger("06", "月度检查")); |
| | | list.add(new DicTrigger("07", "3月末库内普查")); |
| | | list.add(new DicTrigger("08", "9月末库内普查")); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 检验依据 |
| | | * |
| | | * 指标类别 |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerStandard").getResult()} |
| | | * |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分页获取质量巡检记录信息 |
| | | * 检验依据 |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerMetrics").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<DicTrigger> triggerMetrics() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | |
| | | list.add(new DicTrigger("1", "质量指标检验")); |
| | | list.add(new DicTrigger("2", "储存品质检验")); |
| | | list.add(new DicTrigger("3", "食品安全检验")); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 分页获取质量巡检记录信息 |
| | | * <p> |
| | | * qualityManagerPR#listQuality |
| | | * |
| | | * @param page |
| | |
| | | * @throws Exception |
| | | */ |
| | | @DataProvider |
| | | public void listQuality(Page<MQuality> page, Map<String, Object> param) throws Exception{ |
| | | public void listQuality(Page<MQuality> page, Map<String, Object> param) throws Exception { |
| | | qualityManageService.listQuality(page, param); |
| | | } |
| | | |
| | |
| | | * @param data |
| | | */ |
| | | @DataResolver |
| | | public void saveQuality(MQuality data){ |
| | | public void saveQuality(MQuality data) { |
| | | String id = ""; |
| | | if(StringUtils.isEmpty(data.getId())){ |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | id = ManageUtil.createQualityId(data.getType()); |
| | | } |
| | | qualityManageService.saveQuality(id, data); |
| | | |
| | | //保存检测的化验项信息 |
| | | if (null != data.getCheckItems()) { |
| | | checkStandardManager.updateCheckItems(id,null,data.getCheckItems()); |
| | | checkStandardManager.updateCheckItems(id, null, data.getCheckItems()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String delQuality(MQuality data){ |
| | | public String delQuality(MQuality data) { |
| | | return qualityManageService.delQuality(data); |
| | | } |
| | | |
| | |
| | | <?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"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.ld.igds.check.mapper.CheckStandardMapper"> |
| | | |
| | | <!--新增化验数据 --> |
| | | <insert id="insertCheckItem" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | insert into |
| | | D_CHECK_ITEM( |
| | | COMPANY_ID_, |
| | | CHECK_ID_, |
| | | STANDARD_ID_, |
| | | STANDARD_NAME_, |
| | | UNIT_, |
| | | UPPER_LIMIT_, |
| | | OPERA_SYMBOL_, |
| | | RULE_NUM_, |
| | | RULE_ADD_, |
| | | RULE_ADD_END_, |
| | | RULE_REDUCE_, |
| | | VALUE_, |
| | | RULE_PRICE_, |
| | | RULE_REDUCE_PRICE_, |
| | | ADD_NUM_, |
| | | DE_NUM_, |
| | | ADD_PRICE_, |
| | | DE_PRICE_, |
| | | RESULT_, |
| | | REMARKS_ |
| | | )values ( |
| | | #{data.companyId}, |
| | | #{data.checkId}, |
| | | #{data.standardId}, |
| | | #{data.standardName}, |
| | | #{data.unit}, |
| | | #{data.upperLimit}, |
| | | #{data.operaSymbol}, |
| | | #{data.ruleNum}, |
| | | #{data.ruleAdd}, |
| | | #{data.ruleAddEnd}, |
| | | #{data.ruleReduce}, |
| | | #{data.value}, |
| | | #{data.rulePrice}, |
| | | #{data.ruleReducePrice}, |
| | | #{data.addNum}, |
| | | #{data.deNum}, |
| | | #{data.addPrice}, |
| | | #{data.dePrice}, |
| | | #{data.result}, |
| | | #{data.remarks} |
| | | ) |
| | | </insert> |
| | | <!--新增化验数据 --> |
| | | <insert id="insertCheckItem" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | insert into D_CHECK_ITEM(COMPANY_ID_, |
| | | CHECK_ID_, |
| | | STANDARD_ID_, |
| | | STANDARD_NAME_, |
| | | UNIT_, |
| | | UPPER_LIMIT_, |
| | | OPERA_SYMBOL_, |
| | | RULE_NUM_, |
| | | RULE_ADD_, |
| | | RULE_ADD_END_, |
| | | RULE_REDUCE_, |
| | | VALUE_, |
| | | RULE_PRICE_, |
| | | RULE_REDUCE_PRICE_, |
| | | ADD_NUM_, |
| | | DE_NUM_, |
| | | ADD_PRICE_, |
| | | DE_PRICE_, |
| | | RESULT_, |
| | | REMARKS_) |
| | | values (#{data.companyId}, |
| | | #{data.checkId}, |
| | | #{data.standardId}, |
| | | #{data.standardName}, |
| | | #{data.unit}, |
| | | #{data.upperLimit}, |
| | | #{data.operaSymbol}, |
| | | #{data.ruleNum}, |
| | | #{data.ruleAdd}, |
| | | #{data.ruleAddEnd}, |
| | | #{data.ruleReduce}, |
| | | #{data.value}, |
| | | #{data.rulePrice}, |
| | | #{data.ruleReducePrice}, |
| | | #{data.addNum}, |
| | | #{data.deNum}, |
| | | #{data.addPrice}, |
| | | #{data.dePrice}, |
| | | #{data.result}, |
| | | #{data.remarks}) |
| | | </insert> |
| | | |
| | | <!--更新化验项数据 --> |
| | | <update id="updateCheckItem" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | update D_CHECK_ITEM |
| | | <set> |
| | | <if test="data.standardName != null and data.standardName != '' ">STANDARD_NAME_ = #{data.standardName},</if> |
| | | <if test="data.upperLimit != null and data.upperLimit != '' ">UPPER_LIMIT_ = #{data.upperLimit},</if> |
| | | <if test="data.unit != null and data.unit != '' ">UNIT_ = #{data.unit},</if> |
| | | <if test="data.value != null and data.value != '' ">VALUE_ = #{data.value},</if> |
| | | <if test="data.addNum != null">ADD_NUM_ = #{data.addNum},</if> |
| | | <if test="data.deNum != null">DE_NUM_ = #{data.deNum},</if> |
| | | <if test="data.addPrice != null">ADD_PRICE_ = #{data.addPrice},</if> |
| | | <if test="data.dePrice != null">DE_PRICE_ = #{data.dePrice},</if> |
| | | <if test="data.result != null and data.result != '' ">RESULT_ = #{data.result},</if> |
| | | <if test="data.remarks != null and data.remarks != '' ">REMARKS_ = #{data.remarks},</if> |
| | | <if test="data.operaSymbol != null and data.operaSymbol != '' ">OPERA_SYMBOL_ = #{data.operaSymbol}</if> |
| | | </set> |
| | | <where> |
| | | <if test="data.companyId != null and data.companyId != '' "> COMPANY_ID_= #{data.companyId}</if> |
| | | <if test="data.checkId != null">AND CHECK_ID_ = #{data.checkId}</if> |
| | | <if test="data.standardId != null and data.standardId != '' ">AND STANDARD_ID_ = #{data.standardId}</if> |
| | | </where> |
| | | </update> |
| | | <!--更新化验项数据 --> |
| | | <update id="updateCheckItem" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | update D_CHECK_ITEM |
| | | <set> |
| | | <if test="data.standardName != null and data.standardName != '' ">STANDARD_NAME_ = #{data.standardName}, |
| | | </if> |
| | | <if test="data.upperLimit != null and data.upperLimit != '' ">UPPER_LIMIT_ = #{data.upperLimit},</if> |
| | | <if test="data.unit != null and data.unit != '' ">UNIT_ = #{data.unit},</if> |
| | | <if test="data.value != null and data.value != '' ">VALUE_ = #{data.value},</if> |
| | | <if test="data.addNum != null">ADD_NUM_ = #{data.addNum},</if> |
| | | <if test="data.deNum != null">DE_NUM_ = #{data.deNum},</if> |
| | | <if test="data.addPrice != null">ADD_PRICE_ = #{data.addPrice},</if> |
| | | <if test="data.dePrice != null">DE_PRICE_ = #{data.dePrice},</if> |
| | | <if test="data.result != null and data.result != '' ">RESULT_ = #{data.result},</if> |
| | | <if test="data.remarks != null and data.remarks != '' ">REMARKS_ = #{data.remarks},</if> |
| | | <if test="data.operaSymbol != null and data.operaSymbol != '' ">OPERA_SYMBOL_ = #{data.operaSymbol}</if> |
| | | </set> |
| | | <where> |
| | | <if test="data.companyId != null and data.companyId != '' ">COMPANY_ID_= #{data.companyId}</if> |
| | | <if test="data.checkId != null">AND CHECK_ID_ = #{data.checkId}</if> |
| | | <if test="data.standardId != null and data.standardId != '' ">AND STANDARD_ID_ = #{data.standardId}</if> |
| | | </where> |
| | | </update> |
| | | |
| | | <!--更新数据 要求结果值必须为空,避免认为更新后被替换 --> |
| | | <update id="updateItemByResult" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | update D_CHECK_ITEM |
| | | <set> |
| | | <if test="data.unit != null and data.unit != '' ">UNIT_ = #{data.unit},</if> |
| | | <if test="data.value != null and data.value != '' ">VALUE_ = #{data.value},</if> |
| | | <if test="data.remarks != null and data.remarks != '' ">REMARKS_ = #{data.remarks},</if> |
| | | <if test="data.operaSymbol != null and data.operaSymbol != '' ">OPERA_SYMBOL_ = #{data.operaSymbol}</if> |
| | | </set> |
| | | <where> |
| | | <if test="data.companyId != null and data.companyId != '' "> COMPANY_ID_= #{data.companyId}</if> |
| | | <if test="data.checkId != null and data.checkId != '' ">AND CHECK_ID_ = #{data.checkId}</if> |
| | | <if test="data.standardId != null and data.standardId != '' ">AND STANDARD_ID_ = #{data.standardId}</if> |
| | | </where> |
| | | AND VALUE_ IS NULL |
| | | </update> |
| | | <!--更新数据 要求结果值必须为空,避免认为更新后被替换 --> |
| | | <update id="updateItemByResult" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | update D_CHECK_ITEM |
| | | <set> |
| | | <if test="data.unit != null and data.unit != '' ">UNIT_ = #{data.unit},</if> |
| | | <if test="data.value != null and data.value != '' ">VALUE_ = #{data.value},</if> |
| | | <if test="data.remarks != null and data.remarks != '' ">REMARKS_ = #{data.remarks},</if> |
| | | <if test="data.operaSymbol != null and data.operaSymbol != '' ">OPERA_SYMBOL_ = #{data.operaSymbol}</if> |
| | | </set> |
| | | <where> |
| | | <if test="data.companyId != null and data.companyId != '' ">COMPANY_ID_= #{data.companyId}</if> |
| | | <if test="data.checkId != null and data.checkId != '' ">AND CHECK_ID_ = #{data.checkId}</if> |
| | | <if test="data.standardId != null and data.standardId != '' ">AND STANDARD_ID_ = #{data.standardId}</if> |
| | | </where> |
| | | AND VALUE_ IS NULL |
| | | </update> |
| | | <!-- 根据条件删除化验项--> |
| | | <delete id="delCheckItemByParam" parameterType="com.ld.igds.check.dto.CheckItemData"> |
| | | DELETE |
| | | FROM D_CHECK_ITEM |
| | | <where> |
| | | <if test="data.companyId != null and data.companyId != '' ">COMPANY_ID_= #{data.companyId}</if> |
| | | <if test="data.checkId != null and data.checkId != '' ">AND CHECK_ID_ = #{data.checkId}</if> |
| | | </where> |
| | | </delete> |
| | | |
| | | <!-- 根据checkId获取检测结果 --> |
| | | <select id="getCheckItemById" parameterType="java.lang.String" |
| | | resultType="com.ld.igds.check.dto.CheckItemData"> |
| | | select |
| | | CHECK_ID_ as checkId, |
| | | COMPANY_ID_ as companyId, |
| | | STANDARD_ID_ as standardId, |
| | | STANDARD_NAME_ as standardName, |
| | | UNIT_ as unit, |
| | | UPPER_LIMIT_ as upperLimit, |
| | | OPERA_SYMBOL_ as operaSymbol, |
| | | RULE_NUM_ as ruleNum, |
| | | RULE_ADD_ as ruleAdd, |
| | | RULE_ADD_END_ as ruleAddEnd, |
| | | RULE_REDUCE_ as ruleReduce, |
| | | VALUE_ as value, |
| | | <!-- 根据checkId获取检测结果 --> |
| | | <select id="getCheckItemById" parameterType="java.lang.String" |
| | | resultType="com.ld.igds.check.dto.CheckItemData"> |
| | | select CHECK_ID_ as checkId, |
| | | COMPANY_ID_ as companyId, |
| | | STANDARD_ID_ as standardId, |
| | | STANDARD_NAME_ as standardName, |
| | | UNIT_ as unit, |
| | | UPPER_LIMIT_ as upperLimit, |
| | | OPERA_SYMBOL_ as operaSymbol, |
| | | RULE_NUM_ as ruleNum, |
| | | RULE_ADD_ as ruleAdd, |
| | | RULE_ADD_END_ as ruleAddEnd, |
| | | RULE_REDUCE_ as ruleReduce, |
| | | VALUE_ as value, |
| | | RULE_PRICE_ as rulePrice, |
| | | RULE_REDUCE_PRICE_ as ruleReducePrice, |
| | | ADD_NUM_ as addNum, |
| | |
| | | DE_PRICE_ as dePrice, |
| | | RESULT_ as result, |
| | | REMARKS_ as remarks |
| | | from |
| | | D_CHECK_ITEM |
| | | where COMPANY_ID_ = #{companyId} |
| | | and CHECK_ID_ = #{checkId} |
| | | ORDER by STANDARD_ID_ +0 |
| | | </select> |
| | | from |
| | | D_CHECK_ITEM |
| | | where COMPANY_ID_ = #{companyId} |
| | | and CHECK_ID_ = #{checkId} |
| | | ORDER by STANDARD_ID_ +0 |
| | | </select> |
| | | |
| | | <!-- 根据粮食品种获取配的化验信息 --> |
| | | <select id="getCheckStandard" parameterType="java.lang.String" |
| | | resultType="com.ld.igds.check.dto.CheckStandardData"> |
| | | select |
| | | ID_ as id, |
| | | COMPANY_ID_ as companyId, |
| | | FOOD_VARIETY_ as foodVariety, |
| | | STANDARD_ID_ as standardId, |
| | | STANDARD_NAME_ as standardName, |
| | | UNIT_ as unit, |
| | | OPERA_SYMBOL_ as operaSymbol, |
| | | UPPER_LIMIT_ as upperLimit, |
| | | RULE_NUM_ as ruleNum, |
| | | RULE_REDUCE_ as ruleReduce, |
| | | RULE_ADD_ as ruleAdd, |
| | | RULE_ADD_END_ as ruleAddEnd, |
| | | RULE_PRICE_ as rulePrice, |
| | | RULE_REDUCE_PRICE_ as ruleReducePrice, |
| | | UPDATE_TIME_ as updateTime, |
| | | REMARKS_ as remarks |
| | | FROM D_CHECK_STANDARD |
| | | WHERE |
| | | COMPANY_ID_ = #{companyId} |
| | | AND FOOD_VARIETY_ = #{foodVariety} |
| | | ORDER by STANDARD_ID_ + 0 |
| | | </select> |
| | | <!-- 根据粮食品种获取配的化验信息 --> |
| | | <select id="getCheckStandard" parameterType="java.lang.String" |
| | | resultType="com.ld.igds.check.dto.CheckStandardData"> |
| | | select ID_ as id, |
| | | COMPANY_ID_ as companyId, |
| | | FOOD_VARIETY_ as foodVariety, |
| | | STANDARD_ID_ as standardId, |
| | | STANDARD_NAME_ as standardName, |
| | | UNIT_ as unit, |
| | | OPERA_SYMBOL_ as operaSymbol, |
| | | UPPER_LIMIT_ as upperLimit, |
| | | RULE_NUM_ as ruleNum, |
| | | RULE_REDUCE_ as ruleReduce, |
| | | RULE_ADD_ as ruleAdd, |
| | | RULE_ADD_END_ as ruleAddEnd, |
| | | RULE_PRICE_ as rulePrice, |
| | | RULE_REDUCE_PRICE_ as ruleReducePrice, |
| | | UPDATE_TIME_ as updateTime, |
| | | REMARKS_ as remarks |
| | | FROM D_CHECK_STANDARD |
| | | WHERE COMPANY_ID_ = #{companyId} |
| | | AND FOOD_VARIETY_ = #{foodVariety} |
| | | ORDER by STANDARD_ID_ + 0 |
| | | </select> |
| | | |
| | | </mapper> |