SEL ECT dbo.p_public_watch.public_u_unit AS 单位名称, dbo.p_public_watch.meter_name AS 表名称,
dbo.p_public_watch.meter_state AS 表状态, dbo.p_public_watch.card_number AS 卡号,
dbo.p_public_watch.puse AS 用途, dbo.p_public_watch.meter_address AS 表位置,
dbo.p_public_watch.meter_type AS 表类型, dbo.p_public_watch.installation_date AS 安装日期, CONVERT(datetime,
dbo.p_public_watch.ventilate_date) AS 通气日期, CONVERT(datetime, dbo.p_public_watch.start_date) AS 启用日期,
CONVERT(datetime, dbo.p_public_watch.operat_time) AS 操作日期, dbo.p_public_watch.operater_name AS 操作人员,
dbo.p_public_watch.remarks AS 备注, dbo.p_public_watch.Equipment_Situation AS 设备信息,
dbo.p_public_watch.ventilation_people AS 通气人, dbo.p_public_watch.m_t_manufacturers AS 机表厂家,
dbo.p_public_watch.machine_t_type AS 机表型号, dbo.p_public_watch.m_t_sequence AS 机表序列号,
CONVERT(datetime, dbo.p_public_watch.m_t_productiondate) AS 机表出厂日期,
dbo.p_public_watch.m_t_stress AS 机表工作压力, dbo.p_public_watch.m_t_temperature AS 机表工作温度,
dbo.p_public_watch.m_t_flow AS 机表工作流量, CONVERT(datetime, dbo.p_public_watch.c_production_date)
AS 卡控出厂日期, dbo.p_public_watch.card_c_factory AS 卡控厂家, dbo.p_public_watch.card_type AS 卡控型号,
dbo.p_public_watch.card_sequence AS 卡控序列号, dbo.p_public_watch.card_stress AS 卡控工作压力,
dbo.p_public_watch.exchange_meter AS 换表, CONVERT(bit, dbo.p_public_watch.is_mixin) AS 是否混用,
dbo.p_public_watch.is_sale AS 是否停售, CONVERT(bit, dbo.p_public_watch.w_equipment_m)
AS 设备信息与选型是否一致, CONVERT(bit, dbo.p_public_watch.walertor_quality) AS 报警器资质是否已收, CONVERT(bit,
dbo.p_public_watch.walertor_valve) AS 报警器与切断阀是否联动, CONVERT(bit, dbo.p_public_watch.with_valve_gas)
AS 检测阀关是否不过气, dbo.p_public_watch.id AS 表ID, dbo.p_public_watch.p_user_id AS 单位ID,
dbo.p_public_muser.area AS 区域, dbo.p_public_muser.two_area AS 二级区域, dbo.p_public_muser.orientation AS 片区,
dbo.p_public_muser.gas_state AS 用气状态, CONVERT(bit,
CASE p_public_muser.is_cng WHEN '是' THEN 1 ELSE '0' END) AS 是否为煤改气, CONVERT(bit,
CASE p_public_muser.is_regulator WHEN '是' THEN 1 ELSE '0' END) AS 是否为调压站箱,
dbo.p_public_muser.address AS 地址, dbo.p_public_muser.Contacts_Phone AS 联系方式,
dbo.p_public_machine_type.pass_meter_count AS 过表值, dbo.p_public_watch.pin_date AS 表销户日期
FROM dbo.p_public_watch LEFT OUTER JOIN
dbo.p_public_machine_type ON
dbo.p_public_watch.machine_t_type = dbo.p_public_machine_type.machine_type LEFT OUTER JOIN
dbo.p_public_muser ON dbo.p_public_watch.p_user_id = dbo.p_public_muser.id
sel ect * from {V_P_Public_Watch} where 表状态 = '正常'