Ejemplo 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
}
Ejemplo n.º 2
0
func (p *Employee) Fetch(data map[string]interface{}) {
	cbx := cb.CreateEmployeeCB()
	cbx.SetupSelect_UserTable()
	cbx.Query().SetDelFlag_Equal(0)
	p.SetupCriteria(cbx, data)
	//add Order By
	res, err := bhv.EmployeeBhv_I.SelectList(cbx, p.tx)
	if err != nil {
		panic(err.Error())
	}
	list := p.ResultToMap(res)
	p.context.JSON(200, dfweb.SetNormalFetchResult(list))
}
Ejemplo n.º 3
0
func (p *Employee) getOld(id int64) *entity.Employee {
	cbx := cb.CreateEmployeeCB()
	cbx.Query().SetDelFlag_Equal(0)
	cbx.Query().SetId_Equal(id)
	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)
	} else {
		return nil
	}
}
Ejemplo n.º 4
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
}