SELECT
	cast( t1.`person_id` AS CHAR ( 36 ) charset utf8 ) AS `student_id`,
	t1.`id_int` AS `id_int`,
	t1.`xm` AS `xm`,
	t1.`xmpy` AS `xmpy`,
	t1.`cym` AS `cym`,
	t1.`xbm` AS `xbm`,
	DATE_FORMAT(t1.`csrq`,'%Y/%m/%d %H:%i:%s') AS `csrq`,
	t1.`mzm` AS `mzm`,
	t1.`zzmmm` AS `zzmmm`,
	t1.`sfzjlxm` AS `sfzjlxm`,
	t1.`sfzjh` AS `sfzjh`,
	t1.`dszybz` AS `dszybz`,
	t1.`sqznbz` AS `sqznbz`,
	t1.`jcwgrysqznbz` AS `jcwgrysqznbz`,
	t1.`gebz` AS `gebz`,
	t1.`lsetbz` AS `lsetbz`,
	t1.`cjbz` AS `cjbz`,
	cast( t1.`class_id` AS CHAR ( 36 ) charset utf8 ) AS `class_id`,
	cast( t1.`bureau_id` AS CHAR ( 36 ) charset utf8 ) AS `bureau_id`,
	t1.`b_use` AS `b_use`,
	t1.`state_id` AS `state_id`,
	t1.`province_code` AS `province_code`,
	t1.`city_code` AS `city_code`,
	t1.`district_code` AS `district_code`,
	cast( t1.`main_school_id` AS CHAR ( 36 ) charset utf8 ) AS `main_school_id`,
	DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`,
	DATE_FORMAT(t1.`create_time`,'%Y/%m/%d %H:%i:%s') AS `create_time`,
	`t_base_organization`.`main_school_type` AS `main_school_type`,
	`t_base_organization`.`xxbbm` AS `xxbbm`,
	`t_base_organization`.`xxbxlxm` AS `xxbxlxm`,
	`t_base_organization`.`szdcxlxm` AS `szdcxlxm`,
	`t_base_class`.`stage_id` AS `stage_id`,
	cast( `t_base_class`.`rxnf` AS CHAR ( 4 ) charset utf8 ) AS `rxnf` ,
	case t1.`b_use` when -1 then 1 else 0 end AS `del_flag`
FROM
	((
			`t_base_student` as t1
		JOIN `t_base_organization` ON ( t1.`bureau_id` = `t_base_organization`.`org_id` ))
	JOIN `t_base_class` ON ( t1.`class_id` = `t_base_class`.`class_id` ))