package com.sifang.modules.insurance.dao;

import com.sifang.modules.insurance.entity.CrmCustomerEntryInsuranceEndorse;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.common.utils.IdGen;
import org.hibernate.SQLQuery;
import org.springframework.stereotype.Repository;

@Repository
public class CustomerEntryInsuranceEndorseDao extends BaseDao<CrmCustomerEntryInsuranceEndorse> {

    public void deleteByEndorseNo(String endorseNo) {
        SQLQuery sqlQuery = getSession().createSQLQuery("update crm_customer_entry_insurance_endorse set status=:status where endorse_no=:no");
        sqlQuery.setParameter("no", endorseNo);
        sqlQuery.setParameter("status", IdGen.uuid());
        sqlQuery.executeUpdate();
    }
}
