package com.usoftchina.uas.office.qywx.service;

import com.usoftchina.uas.office.qywx.entity.OutSign;
import com.usoftchina.uas.office.service.AbstractService;
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.stereotype.Service;

/**
 * @author yingp
 * @date 2020/2/17
 */
@Service
public class UasOutSignService extends AbstractService {

    public void save(OutSign sign) {
        sign.setMo_id(generateId("MOBILE_OUTSIGN_SEQ"));
        sign.setMo_code(generateCode("mobile_outsign", 2));
        SimpleJdbcInsert insert = new SimpleJdbcInsert(jdbcTemplate);
        insert.withTableName("MOBILE_OUTSIGN").execute(new BeanPropertySqlParameterSource(sign));
    }
}
