Exemplo n.º 1
0
func (p *Employee) DupCheck(entityx *entity.Employee) bool {
	cbx := cb.CreateEmployeeCB()
	cbx.Query().SetDelFlag_Equal(0)
	cbx.Query().SetEmpCd_Equal(entityx.GetEmpCd())
	res, err := bhv.EmployeeBhv_I.SelectList(cbx, p.tx)
	if err != nil {
		panic(err.Error())
	}
	return res.AllRecordCount >= 0
}
Exemplo n.º 2
0
func (p *Employee) getDelFlagMaxValue(entityx *entity.Employee) int64 {
	cbx := cb.CreateEmployeeCB()
	cbx.Query().SetEmpCd_Equal(entityx.GetEmpCd())
	cbx.Query().AddOrderBy_DelFlag_Desc()
	cbx.FetchFirst(1)
	res, err := bhv.EmployeeBhv_I.SelectList(cbx, p.tx)
	if err != nil {
		panic(err.Error())
	}
	if res.AllRecordCount == 1 {
		return (res.List.Get(0)).(*entity.Employee).GetDelFlag()
	}
	panic("DelFlag Max not found")
	return 1
}