insert into room_renovation_record(record_id,r_id,staff_id,staff_name,state,remark,create_time,is_true) values (#{recordId},#{rId},#{staffId},#{staffName},#{state},#{remark},#{createTime},#{isTrue})
SELECT
re.record_id recordId,
re.r_id rId,
re.staff_id staffId,
re.staff_name staffName,
re.remark,
re.state,
re.is_true isTrue,
td. NAME stateName,
re.create_time createTime,
r.room_id roomId,
r.room_name roomName,
fr.file_real_name fileRealName,
fr.file_save_name fileSaveName,
fr.rel_type_cd relTypeCd
FROM
room_renovation_record re
LEFT JOIN room_renovation r ON re.r_id = r.r_id
AND r.status_cd = '0'
LEFT JOIN t_dict td ON td.table_name = 'room_renovation_record'
AND td.table_columns = 'state'
AND re.state = td.status_cd
LEFT JOIN file_rel fr ON re.record_id = fr.obj_id
AND fr.status_cd = "0"
WHERE 1 = 1
and re.record_id= #{recordId}
and re.r_id= #{rId}
and re.staff_id= #{staffId}
and re.staff_name like '%{staffName}%'
and re.remark= #{remark}
and re.state= #{state}
and r.room_id = #{roomId}
and r.room_name= #{roomName}
and re.status_cd = #{statusCd}
and re.is_true = #{isTrue}
and re.create_time= #{createTime}
order by re.create_time desc
limit #{page}, #{row}
select count(1) count
from room_renovation_record re
LEFT JOIN room_renovation r ON re.r_id = r.r_id
AND r.status_cd = '0'
LEFT JOIN file_rel fr ON re.record_id = fr.obj_id
AND fr.status_cd = '0'
where 1 = 1
and re.record_id= #{recordId}
and re.r_id= #{rId}
and re.staff_id= #{staffId}
and re.staff_name like '%{staffName}%'
and re.remark= #{remark}
and re.state= #{state}
and r.room_id = #{roomId}
and r.room_name= #{roomName}
and re.status_cd = #{statusCd}
and re.is_true = #{isTrue}
and re.create_time= #{createTime}
SELECT
re.record_id recordId,
re.r_id rId,
re.staff_id staffId,
re.staff_name staffName,
re.remark,
re.state,
td.name stateName,
re.is_true isTrue,
td2.name isTrueName,
re.create_time createTime,
r.room_id roomId,
r.room_name roomName
FROM
room_renovation_record re
LEFT JOIN room_renovation r ON re.r_id = r.r_id
AND r.status_cd = '0'
LEFT JOIN t_dict td ON td.table_name = 'room_renovation_record'
AND td.table_columns = 'state'
AND re.state = td.status_cd
LEFT JOIN t_dict td2 ON td2.table_name = 'room_renovation_record'
AND td2.table_columns = 'is_true' AND re.is_true = td2.status_cd
WHERE 1 = 1
and re.record_id= #{recordId}
and re.r_id= #{rId}
and re.staff_id= #{staffId}
and re.staff_name like '%{staffName}%'
and re.remark= #{remark}
and re.state= #{state}
and r.room_id = #{roomId}
and r.room_name= #{roomName}
and re.status_cd = #{statusCd}
and re.is_true = #{isTrue}
and re.create_time= #{createTime}
order by re.create_time desc
limit #{page}, #{row}
select count(1) count
from room_renovation_record re
LEFT JOIN room_renovation r ON re.r_id = r.r_id
AND r.status_cd = '0'
where 1 = 1
and re.record_id= #{recordId}
and re.r_id= #{rId}
and re.staff_id= #{staffId}
and re.staff_name like '%{staffName}%'
and re.remark= #{remark}
and re.state= #{state}
and r.room_id = #{roomId}
and r.room_name= #{roomName}
and re.status_cd = #{statusCd}
and re.is_true = #{isTrue}
and re.create_time= #{createTime}
update room_renovation_record r set r.status_cd = #{statusCd}
where 1=1
and r.record_id= #{recordId}