# ResistDAOImpl.java

    package com.mycim.server.resist.dao.impl;

    import com.fa.sesa.threadlocal.LocalContext;
    import com.mycim.framework.jdbc.JdbcTemplate;
    import com.mycim.framework.jdbc.Page;
    import com.mycim.framework.jdbc.mapper.RowMapper;
    import com.mycim.framework.utils.MiscUtils;
    import com.mycim.framework.utils.lang.StringUtils;
    import com.mycim.framework.utils.lang.collections.MapUtils;
    import com.mycim.framework.utils.lang.time.DateUtils;
    import com.mycim.server.resist.dao.ResistDAO;
    import com.mycim.server.resist.dao.mapper.ResistRowMapper;
    import com.mycim.valueobject.ObjectList;
    import com.mycim.valueobject.consts.DataBaseNames;
    import com.mycim.valueobject.ems.EventModel;
    import com.mycim.valueobject.ems.Resist;
    import com.mycim.valueobject.ems.ResistEnum;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Repository;

    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;

    /**
     * @author yanbing.chen
     * @version 6.0.0
     * @date 2019/10/29
     **/
    @Repository
    public class ResistDAOImpl implements ResistDAO {

        @Autowired
        JdbcTemplate jdbcTemplate;

        @Override
        public Page qryResistByPage(Page page, Map<String, Object> argMap) {

            String instanceId = MapUtils.getString(argMap, "instanceId");
            String resistNo = MapUtils.getString(argMap, "resistNo");
            String resistName = MapUtils.getString(argMap, "resistName");
            String materialNo = MapUtils.getString(argMap, "materialNo");
            List<String> resistStatus = null;
            if (StringUtils.isNotBlank(StringUtils.toString(MapUtils.getObject(argMap, "resistStatus")))) {
                resistStatus = (List<String>) argMap.get("resistStatus");
            }

            String eqptId = MapUtils.getString(argMap, "eqptId");

            String receivedBy = MapUtils.getString(argMap, "receivedBy");
            String receiveStartDate = MapUtils.getString(argMap, "receiveStartDate");
            String receiveEndDate = MapUtils.getString(argMap, "receiveEndDate");
            String modifyBy = MapUtils.getString(argMap, "modifyBy");
            String modifyStartDate = MapUtils.getString(argMap, "modifyStartDate");
            String modifyEndDate = MapUtils.getString(argMap, "modifyEndDate");

            List<String> args = new ArrayList<>();

            StringBuilder sb = new StringBuilder(" SELECT ");

            sb.append(" R.OBJ_STATUS, R.SYS_RRN INSTANCE_RRN,R.INSTANCE_ID,R.OBJ_SPACE, R.OBJ_TYPE, R")
              .append(".EXPIRE_DATE,R.EQPTID,R.UNIT,R.PRPIPE,R.CREATE_BY,R.MODIFY_BY,R.CREATE_TIME,R")
              .append(".MODIFY_TIME, R.VENDOR_BARCODE,");
            sb.append(" RP.RESIST_NO,RP.RESIST_NAME,RP.MATERIAL_NO,RP.LIFETIME_TYPE,RP.DEFROST_TIME,RP")
              .append(".BUFFER_DAYS, ");
            sb.append(" RS.CURRENT_STATUS  ");
            sb.append(" FROM RESIST R, RESIST_MAPPING RP, RESIST_STATUS RS ");
            sb.append(" WHERE R.RESIST_NO = RP.RESIST_NO AND R.RESIST_RRN=RS.RESIST_SYS_RRN ");

            if (StringUtils.isNotBlank(instanceId)) {
                sb.append(" AND R.INSTANCE_ID LIKE ? ");
                args.add(StringUtils.replace(instanceId, "*", "%").toString());

            }
            if (StringUtils.isNotBlank(resistNo)) {
                sb.append(" AND R.RESIST_NO LIKE ? ");
                args.add(StringUtils.replace(resistNo, "*", "%").toString());

            }
            if (StringUtils.isNotBlank(resistName)) {
                sb.append(" AND RP.RESIST_NAME LIKE ? ");
                args.add(StringUtils.replace(resistName, "*", "%").toString());

            }
            if (StringUtils.isNotBlank(materialNo)) {
                sb.append(" AND RP.MATERIAL_NO LIKE ? ");
                args.add(StringUtils.replace(materialNo, "*", "%").toString());
            }
            if (resistStatus != null && resistStatus.size() > 0) {
                sb.append(" AND RS.CURRENT_STATUS IN ( " + StringUtils.repeat("?,", resistStatus.size() - 1) + "?)");
                for (String status : resistStatus) {
                    args.add(status);
                }
            }

            if (StringUtils.isNotBlank(eqptId)) {
                sb.append(" AND R.EQPTID LIKE ? ");
                args.add(StringUtils.trimToUpperCase(StringUtils.replace(eqptId, "*", "%").toString()));

            }
            if (StringUtils.isNotBlank(receivedBy)) {
                sb.append(" AND R.CREATE_BY LIKE ? ");
                args.add(StringUtils.replace(receivedBy, "*", "%").toString());

            }
            if (StringUtils.isNotBlank(modifyBy)) {
                sb.append(" AND R.MODIFY_BY LIKE ? ");
                args.add(StringUtils.replace(modifyBy, "*", "%").toString());

            }
            if (StringUtils.isNotBlank(receiveStartDate)) {
                sb.append(" AND R.CREATE_TIME>to_timestamp(?,'" + DateUtils.DATE_FORMAT24 + "')");
                args.add(StringUtils.replace(receiveStartDate, "*", "%").toString() + " 00:00:00");

            }
            if (StringUtils.isNotBlank(receiveEndDate)) {
                sb.append(" AND R.CREATE_TIME<=to_timestamp(?,'" + DateUtils.DATE_FORMAT24 + "')");
                args.add(StringUtils.replace(receiveEndDate, "*", "%").toString() + " 23:59:59");

            }
            if (StringUtils.isNotBlank(modifyStartDate)) {
                sb.append(" AND R.MODIFY_TIME>to_timestamp(?,'" + DateUtils.DATE_FORMAT24 + "')");
                args.add(StringUtils.replace(modifyStartDate, "*", "%").toString() + " 00:00:00");

            }
            if (StringUtils.isNotBlank(modifyEndDate)) {
                sb.append(" AND R.MODIFY_TIME<=to_timestamp(?,'" + DateUtils.DATE_FORMAT24 + "')");
                args.add(StringUtils.replace(modifyEndDate, "*", "%").toString() + " 23:59:59");

            }
            sb.append(" ORDER BY R.CREATE_TIME ASC ");
            return jdbcTemplate.queryForPage(page, sb.toString(), args.toArray(), new ResistRowMapper());
        }

        @Override
        public Boolean hasVendorBarodeReceived(String vendorBarcode) {
            String sql = "SELECT COUNT(*) FROM RESIST R WHERE R.VENDOR_BARCODE = ?";
            return jdbcTemplate.queryForObject(sql, new Object[]{vendorBarcode}, int.class) > 0;
        }

        @Override
        public Boolean hasResistIdReceived(String resistId) {
            String sql = "SELECT COUNT(*) FROM RESIST R WHERE R.INSTANCE_ID = ?";
            return jdbcTemplate.queryForObject(sql, new Object[]{resistId}, int.class) > 0;
        }
        @Override
        public Long getMaxSerialNumber(String resistNo) {
            String sql = "select NVL(max(r.serial_number),0) from resist r  where r.resist_no = ? ";
            return jdbcTemplate.queryForObject(sql, new Object[]{resistNo}, Long.class);
        }

        @Override
        public void addResist(Resist resist) {
            String sql = " INSERT INTO " + DataBaseNames.RESIST + " (RESIST_RRN, VENDOR_BARCODE,EXPIRE_DATE,RESIST_NO," +
                    "SERIAL_NUMBER," + " EQPTID, PRPIPE, UNIT, " + " CREATE_BY, MODIFY_BY, CREATE_TIME, MODIFY_TIME," +
                    "INSTANCE_ID," + " SYS_RRN,DESCRIPTION,FACILITY_RRN,OBJ_SPACE,OBJ_TYPE,OBJ_STATUS," + " " +
                    "ALLOWABLE_EVENTS_RRN,AVAILABILITY,PRV_LOCATION_RRN,LOCK_VERSION)" + " VALUES (?, ?, to_timestamp(?," +
                    "'" + DateUtils.DATE_FORMAT24 + "'), ?, ?, ?, ?, ?, ?, ?,sysdate, sysdate,?," + " ?,?,?,?,?,?,?,?,?,?)";

            Object[] args = new Object[]{resist.getInstanceRrn(), resist.getVendorBarcode(), resist.getExpireDate(),
                                         resist.getResistNo(), resist.getSerialNumber(), resist.getEqptId(),
                                         resist.getPrPipe(), resist.getUnit(), resist.getCreateBy(),
                                         resist.getModifyBy(), resist.getInstanceId(), resist.getInstanceRrn(),
                                         resist.getInstanceDesc(), LocalContext.getFacilityRrn(), resist.getNamedSpace(),
                                         resist.getObjectType(), resist.getInstanceStatus(),
                                         resist.getAllowableEventsRrn(), resist.getAvailability(),
                                         resist.getPrevLocationRrn(), resist.getLockVersion()};
            jdbcTemplate.update(sql, args);
        }

        @Override
        public void addResistH(Resist resist) {
            String sql = "INSERT INTO " + DataBaseNames.RESIST_H + " (TRANS_RRN, TRANS_SEQUENCE, RESIST_RRN, " +
                    "VENDOR_BARCODE,EXPIRE_DATE, " + " RESIST_NO,SERIAL_NUMBER, EQPTID, PRPIPE, UNIT, " + " " +
                    "PREV_CURRENT_STATUS, CURRENT_STATUS, CREATE_BY, MODIFY_BY, CREATE_TIME, MODIFY_TIME," + " " +
                    "INSTANCE_ID,COMMENTS," + " TRANS_ID,SYS_RRN,DESCRIPTION,FACILITY_RRN,OBJ_SPACE,OBJ_TYPE,OBJ_STATUS," +
                    " ALLOWABLE_EVENTS_RRN,AVAILABILITY,PRV_LOCATION_RRN)" +
                    " SELECT ?, ?, RESIST_RRN, VENDOR_BARCODE,to_timestamp(?,'" + DateUtils.DATE_FORMAT24 + "'),RESIST_NO," +
                    " SERIAL_NUMBER, EQPTID, PRPIPE, UNIT, ?, ?, CREATE_BY, MODIFY_BY, " +
                    " CREATE_TIME, MODIFY_TIME,INSTANCE_ID,?," +
                    " ?,SYS_RRN,DESCRIPTION,FACILITY_RRN,OBJ_SPACE,OBJ_TYPE,OBJ_STATUS," +
                    " ALLOWABLE_EVENTS_RRN,AVAILABILITY,PRV_LOCATION_RRN " + " FROM " + DataBaseNames.RESIST +
                    " WHERE RESIST_RRN = ?";

            Object[] args = new Object[]{resist.getTransRrn(), resist.getTransSequence(), resist.getExpireDate(),
                                         resist.getPrevEntityStatus(), resist.getCurrentEntityStatus(),
                                         resist.getComments(), resist.getTransId(), resist.getInstanceRrn()};
            jdbcTemplate.update(sql, args);
        }

        @Override
        public Resist getResistByResistId(String instanceId) {
            StringBuilder sb = new StringBuilder(" SELECT ");

            sb.append(" R.OBJ_STATUS, R.SYS_RRN INSTANCE_RRN,R.INSTANCE_ID,R.OBJ_SPACE, R.OBJ_TYPE, R")
              .append(".EXPIRE_DATE,R.EQPTID,R.UNIT,R.PRPIPE,R.CREATE_BY,R.MODIFY_BY,R.CREATE_TIME,R")
              .append(".MODIFY_TIME, R.VENDOR_BARCODE,");
            sb.append(" RP.RESIST_NO,RP.RESIST_NAME,RP.MATERIAL_NO,RP.LIFETIME_TYPE,RP.DEFROST_TIME,RP")
              .append(".BUFFER_DAYS, ");
            sb.append(" RS.CURRENT_STATUS ");
            sb.append(" FROM RESIST R, RESIST_MAPPING RP, RESIST_STATUS RS ");
            sb.append(" WHERE R.RESIST_NO = RP.RESIST_NO AND R.RESIST_RRN=RS.RESIST_SYS_RRN");

            sb.append(" AND R.INSTANCE_ID = ? ");

            return jdbcTemplate.queryForObjectWithNull(sb.toString(), new Object[]{instanceId}, new ResistRowMapper());

        }

        @Override
        public Resist getRecommendResist(Resist resist) {
            StringBuilder sb = new StringBuilder(" SELECT * FROM (SELECT ");
            sb.append("R.OBJ_STATUS, R.SYS_RRN INSTANCE_RRN,R.INSTANCE_ID, R.OBJ_SPACE, R.OBJ_TYPE, R")
              .append(".EXPIRE_DATE,R.EQPTID,R.UNIT,R.PRPIPE,R.CREATE_BY,R.MODIFY_BY,R.CREATE_TIME,R")
              .append(".MODIFY_TIME, R.VENDOR_BARCODE,");
            sb.append(" RP.RESIST_NO,RP.RESIST_NAME,RP.MATERIAL_NO,RP.LIFETIME_TYPE,RP.DEFROST_TIME,RP")
              .append(".BUFFER_DAYS, ");
            sb.append(" RS.CURRENT_STATUS  ");
            sb.append(" FROM RESIST R, RESIST_MAPPING RP, RESIST_STATUS RS ");
            sb.append(" WHERE R.RESIST_NO = RP.RESIST_NO AND R.RESIST_RRN=RESIST_SYS_RRN");
            sb.append(" AND R.EQPTID IS NULL AND R.UNIT IS NULL AND R.PRPIPE IS NULL ");
            sb.append(" AND R.RESIST_NO = ? AND RS.CURRENT_STATUS = ? ");
            sb.append(" ORDER BY R.CREATE_TIME ASC ) L where rownum = 1 ");

            return jdbcTemplate
                    .queryForObjectWithNull(sb.toString(), new Object[]{resist.getResistNo(), ResistEnum.READY.getValue()},
                                            new ResistRowMapper());

        }

        @Override
        public void modifyResistExpireDate(Resist resist) {
            String sql = "UPDATE RESIST SET MODIFY_BY= ?, MODIFY_TIME= sysdate, EXPIRE_DATE=to_timestamp(?,'" +
                    DateUtils.DATE_FORMAT24 + "') WHERE RESIST_RRN=? ";
            jdbcTemplate.update(sql, resist.getModifyBy(), resist.getExpireDate(), resist.getInstanceRrn());

        }

        @Override
        public void deleteResist(Long resistRrn) {
            String sql = "DELETE FROM RESIST WHERE RESIST_RRN=?";
            jdbcTemplate.update(sql, new Object[]{resistRrn});
        }

        @Override
        public void modifyResistEqptInfo(Resist resist) {
            StringBuffer sql = new StringBuffer("UPDATE RESIST SET EQPTID=? ,PRPIPE=?,UNIT=?,MODIFY_BY=?,")
                    .append("MODIFY_TIME=sysdate WHERE RESIST_RRN=? AND RESIST_RRN=? ");
            jdbcTemplate.update(sql.toString(),
                                new Object[]{resist.getEqptId(), resist.getPrPipe(), resist.getUnit(),
                                             resist.getModifyBy(), resist.getInstanceRrn(), resist.getInstanceRrn()});
        }

        @Override
        public Page qryResistHistByPage(Map<String, Object> paramMap, Page page) {
            StringBuilder sql = new StringBuilder("SELECT ");
            sql.append("H.TRANS_ID, H.CREATE_TIME, H.MODIFY_BY, H.INSTANCE_ID, H.EXPIRE_DATE, H")
               .append(".RESIST_NO,H.VENDOR_BARCODE, ");
            sql.append("H.EQPTID, H.PRPIPE, H.UNIT, H.PREV_CURRENT_STATUS, H.CURRENT_STATUS,H.COMMENTS ");
            sql.append("FROM RESIST_H H, TRANSACTION_LOG T ");
            sql.append("WHERE H.TRANS_RRN = T.TRANS_RRN ");

            List<Object> argList = new ArrayList<Object>();

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "resistNo"))) {
                sql.append("AND H.RESIST_NO LIKE ? ");
                argList.add(MapUtils.getString(paramMap, "resistNo"));
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "eqptId"))) {
                sql.append("AND H.EQPTID LIKE ? ");
                argList.add(MapUtils.getString(paramMap, "eqptId"));
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "instanceId"))) {
                sql.append("AND H.INSTANCE_ID LIKE ? ");
                argList.add(MapUtils.getString(paramMap, "instanceId"));
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "materialNo"))) {
                sql.append(" ");
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "resistName"))) {
                sql.append(" ");
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "modifyBy"))) {
                sql.append("AND H.MODIFY_BY LIKE ? ");
                argList.add(MapUtils.getString(paramMap, "modifyBy"));
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "modifyStartDate"))) {
                sql.append("AND T.TRANS_START_TIMESTAMP > to_timestamp (?,'" + DateUtils.DATE_FORMAT24 + "') ");
                argList.add(MapUtils.getString(paramMap, "modifyStartDate") + " 00:00:00");
            }

            if (StringUtils.isNotBlank(MapUtils.getString(paramMap, "modifyEndDate"))) {
                sql.append("AND T.TRANS_START_TIMESTAMP <= to_timestamp (?,'" + DateUtils.DATE_FORMAT24 + "') ");
                argList.add(MapUtils.getString(paramMap, "modifyEndDate") + " 23:59:59");
            }

            sql.append("ORDER BY T.TRANS_START_TIMESTAMP DESC, H.TRANS_SEQUENCE DESC ");

            return jdbcTemplate.queryForPage(page, sql.toString(), argList.toArray(), new RowMapper<Resist>() {

                @Override
                public Resist mapRow(ResultSet rs, int rowNum) throws SQLException {
                    Resist resist = new Resist();
                    resist.setTransId(rs.getString("TRANS_ID"));
                    resist.setCreateTime(DateUtils.parse(rs.getString("CREATE_TIME"), DateUtils.DATE_FORMAT4DATE));
                    resist.setCreateBy(rs.getString("MODIFY_BY"));
                    resist.setComments(rs.getString("comments"));
                    resist.setInstanceId(rs.getString("INSTANCE_ID"));
                    resist.setExpireDate(rs.getString("EXPIRE_DATE"));
                    resist.setResistNo(rs.getString("RESIST_NO"));
                    resist.setEqptId(rs.getString("EQPTID"));
                    resist.setPrPipe(rs.getString("PRPIPE"));
                    resist.setUnit(rs.getString("UNIT"));
                    resist.setPrevEntityStatus(rs.getString("PREV_CURRENT_STATUS"));
                    resist.setCurrentEntityStatus(rs.getString("CURRENT_STATUS"));
                    resist.setVendorBarcode(rs.getString("VENDOR_BARCODE"));
                    return resist;
                }
            });
        }

        @Override
        public void updateResistAvailability(long eventRrn, long resistRrn) {
            String sql = "UPDATE " + DataBaseNames.RESIST + " SET AVAILABILITY=" + " nvl((SELECT V.TARGET_AVAILABILITY " +
                    "FROM EVENT V WHERE V" + ".ENTITY_TYPE=? AND V.EVENT_RRN=?),'') WHERE RESIST_RRN=?";
            Object[] args = new Object[]{ObjectList.RESIST_KEY, eventRrn, resistRrn};

            jdbcTemplate.update(sql, args);
        }

        @Override
        public Resist getResistByResistRrn(long resistRrn) {
            StringBuilder sb = new StringBuilder(" SELECT ");

            sb.append("R.OBJ_STATUS, R.SYS_RRN INSTANCE_RRN,R.INSTANCE_ID,R.OBJ_SPACE, R.OBJ_TYPE, R")
              .append(".EXPIRE_DATE,R.EQPTID,R.UNIT,R.PRPIPE,R.CREATE_BY,R.MODIFY_BY,R.CREATE_TIME,R")
              .append(".MODIFY_TIME, R.VENDOR_BARCODE,");
            sb.append(" RP.RESIST_NO,RP.RESIST_NAME,RP.MATERIAL_NO,RP.LIFETIME_TYPE,RP.DEFROST_TIME,RP")
              .append(".BUFFER_DAYS, ");
            sb.append(" RS.CURRENT_STATUS  ");
            sb.append(" FROM RESIST R, RESIST_MAPPING RP, RESIST_STATUS RS ");
            sb.append(" WHERE R.RESIST_NO = RP.RESIST_NO AND R.RESIST_RRN=RS.RESIST_SYS_RRN");

            sb.append(" AND R.RESIST_RRN = ? ");

            return jdbcTemplate.queryForObjectWithNull(sb.toString(), new Object[]{resistRrn}, new ResistRowMapper());
        }

        @Override
        public List<Map> getResistEventIdBy2Status(long resistRrn, String currentStatus, String targetStatus) {
            StringBuilder sql = new StringBuilder("SELECT DISTINCT r.RESIST_RRN, m.event_rrn, getinstanceid ( re.to_rrn ) AS event_id ");
            sql.append(", m.valid_status, m.target_status, getinstanceid ( r.allowable_events_rrn ) AS allowable_events_id ");
            sql.append(" FROM relation re, event_model m, resist r LEFT JOIN RESIST_STATUS rs ON r.RESIST_RRN = rs.RESIST_SYS_RRN ");
            sql.append(" WHERE r.ALLOWABLE_EVENTS_RRN = re.from_rrn  AND re.link_type = 'ALLOWABLEEVENT_TO_EVENT'  AND re.to_rrn = m.event_rrn ");
            sql.append(" AND m.valid_status = rs.current_status  AND rs.current_status = ?  AND m.target_status = ? ");
            sql.append(" AND r.RESIST_RRN = ?");
            List args = new ArrayList();
            args.add(currentStatus);
            args.add(targetStatus);
            args.add(resistRrn);

            return jdbcTemplate.query(sql.toString(),args.toArray(), new RowMapper<Map>() {

                @Override
                public Map mapRow(ResultSet rs, int rowNum) throws SQLException {
                    Map<String, Object> eventMap = new HashMap<String, Object>();
                    eventMap.put("resistRrn", rs.getLong("RESIST_RRN"));
                    eventMap.put("allowEventsId", rs.getString("allowable_events_id"));
                    eventMap.put("eventRrn", rs.getString("event_rrn"));
                    eventMap.put("eventId", rs.getString("event_id"));
                    eventMap.put("validStatus", rs.getString("valid_status"));
                    eventMap.put("currentStatus", currentStatus);
                    eventMap.put("targetStatus", rs.getString("target_status"));
                    return eventMap;
                }
            });
        }

        @Override
        public List<EventModel> getResistEventModels(long eventRrn, long resistRrn) {
            StringBuilder sql = new StringBuilder("SELECT ");
            sql.append(" A.STATUS_GROUP_ID, VALID_STATUS, TARGET_STATUS, MODIFIABLE_FLAG, CURRENT_STATUS FROM ");
            sql.append(" EVENT_MODEL A, RESIST_STATUS B WHERE event_rrn = ?  AND A.STATUS_GROUP_ID = B.STATUS_GROUP_ID ");
            sql.append(" AND RESIST_SYS_RRN = ? ");
            List args = new ArrayList();
            args.add(eventRrn);
            args.add(resistRrn);

            return jdbcTemplate.query(sql.toString(),args.toArray(), new RowMapper<EventModel>() {

                @Override
                public EventModel mapRow(ResultSet rs, int rowNum) throws SQLException {
                    EventModel eventModel = new EventModel();
                    eventModel.setStatusGroupId(rs.getString("STATUS_GROUP_ID"));
                    eventModel.setValidStatus(rs.getString("VALID_STATUS"));
                    eventModel.setTargetStatus(rs.getString("TARGET_STATUS"));
                    eventModel.setModifiableFlag(MiscUtils.reverseCheckBox(rs.getString("MODIFIABLE_FLAG")));
                    eventModel.setCurrentStatus(rs.getString("CURRENT_STATUS"));
                    return eventModel;
                }
            });
        }

    }