コード例 #1
0
func (p *Customer) DupCheck(entityx *entity.Customer) bool {
	cbx := cb.CreateCustomerCB()
	cbx.Query().SetDelFlag_Equal(0)
	cbx.Query().SetCusCd_Equal(entityx.GetCusCd())
	res, err := bhv.CustomerBhv_I.SelectList(cbx, p.tx)
	if err != nil {
		panic(err.Error())
	}
	return res.AllRecordCount > 0
}
コード例 #2
0
func (p *Customer) getDelFlagMaxValue(entityx *entity.Customer) int64 {
	cbx := cb.CreateCustomerCB()
	cbx.Query().SetCusCd_Equal(entityx.GetCusCd())
	cbx.Query().AddOrderBy_DelFlag_Desc()
	cbx.FetchFirst(1)
	res, err := bhv.CustomerBhv_I.SelectList(cbx, p.tx)
	if err != nil {
		panic(err.Error())
	}
	if res.AllRecordCount == 1 {
		return (res.List.Get(0)).(*entity.Customer).GetDelFlag()
	}
	panic("DelFlag Max not found")
	return 1
}