SELECT a.id AS business_id,a.business_code AS business_code,a.business_type AS business_type,a.apply_amount AS apply_amount,
a.apply_time AS apply_time,a.create_time AS create_time,c.name AS name,c.phone AS phone,w.id AS id,
w.role_id AS role_id,w.audit_status AS audit_status,w.operation_status AS operation_status,
b.business_status AS business_status,i.user_id AS i_user_id,ass.emp_id AS ass_user_id,m.emp_id AS m_user_id,
ab.A AS a_user_id,ab.B AS b_user_id
FROM dg_work_conference_consider AS w
LEFT JOIN dg_apply_amount_info AS a
ON a.id = w.business_id
left join dg_business_company c on c.business_id = a.id
/* LEFT JOIN crms_company_customer AS cc
ON a.company_id = cc.id
LEFT JOIN crms_customer AS c
ON cc.customer_id = c.id*/
LEFT JOIN dg_business_process_status AS b
ON b.business_id = a.id
LEFT JOIN (SELECT business_id,SUM(CASE role_id WHEN 59 THEN emp_id ELSE 0 END) AS A,
SUM(CASE role_id WHEN 60 THEN emp_id ELSE 0 END) AS B
FROM dg_guarantee_assign_user GROUP BY business_id) AS ab
ON a.id = ab.business_id
LEFT JOIN dg_compliance_investigation AS i
ON a.id = i.business_id
LEFT JOIN dg_assets_investigation AS ass
ON a.id = ass.business_id
LEFT JOIN dg_message_investigation AS m
ON a.id = m.business_id
WHERE /*c.del_or_not = 0*/
/*AND*/ (w.user_id = #{userId} OR w.user_id IS NULL)
AND w.role_id IN
#{roleId}
AND i.role_id = 70
AND ass.role_id = 64
AND m.role_id = 67
AND (a.business_code LIKE CONCAT('%',#{codeOrName},'%') OR c.name LIKE CONCAT('%',#{codeOrName},'%'))
ORDER BY a.create_time DESC
SELECT a.business_code AS business_code,a.business_type AS business_type,a.apply_amount AS apply_amount,
a.apply_time AS apply_time,a.create_time AS create_time,c.name AS name,c.phone AS phone,w.audit_status AS audit_status,
w.operation_status AS operation_status,b.business_status AS business_status,i.user_id AS i_user_id,ass.emp_id AS ass_user_id,
m.emp_id AS m_user_id,ab.A AS a_user_id,ab.B AS b_user_id
FROM dg_work_conference_consider AS w
LEFT JOIN dg_apply_amount_info AS a
ON a.id = w.business_id
left join dg_business_company c on c.business_id = a.id
/* LEFT JOIN crms_company_customer AS cc
ON a.company_id = cc.id
LEFT JOIN crms_customer AS c
ON cc.customer_id = c.id*/
LEFT JOIN dg_business_process_status AS b
ON b.business_id = a.id
LEFT JOIN (SELECT business_id,SUM(CASE role_id WHEN 59 THEN emp_id ELSE 0 END) AS A,
SUM(CASE role_id WHEN 60 THEN emp_id ELSE 0 END) AS B
FROM dg_guarantee_assign_user GROUP BY business_id) AS ab
ON a.id = ab.business_id
LEFT JOIN dg_compliance_investigation AS i
ON a.id = i.business_id
LEFT JOIN dg_assets_investigation AS ass
ON a.id = ass.business_id
LEFT JOIN dg_message_investigation AS m
ON a.id = m.business_id
WHERE /*c.del_or_not = 0*/
/*AND*/ i.role_id = 70
AND ass.role_id = 64
AND m.role_id = 67
AND w.id IN
#{id}
ORDER BY a.create_time DESC
UPDATE dg_work_conference_consider
SET user_id = #{userId},opinion = #{opinion},audit_status = #{auditStatus},operation_status = #{operationStatus},
update_time = #{date},join_judge = #{joinJudge}
WHERE id = #{id}
SELECT company_id,business_id FROM dg_work_conference_consider WHERE id = #{id}
INSERT INTO dg_loan_committee_consider (business_id,company_id,role_id,status,operating_status,create_time,update_time)
VALUES (#{lcc.businessId},#{lcc.companyId},#{lcc.roleId},#{lcc.status},#{lcc.operatingStatus},#{lcc.createTime},#{lcc.updateTime})
SELECT opinion AS remark,join_judge FROM dg_work_conference_consider WHERE id = #{id}
UPDATE dg_work_conference_consider SET audit_status = #{auditStatus} WHERE business_id = #{businessId}
UPDATE dg_work_conference_consider SET operation_status = #{operationStatus},opinion = #{opinion} WHERE id = #{id}
UPDATE dg_work_conference_consider SET operation_status = #{operationStatus} WHERE id = #{id}
UPDATE dg_work_conference_consider SET user_id = #{userId} WHERE id = #{id}
SELECT w.id,w.business_id,a.business_code,a.business_type,a.apply_amount,
a.apply_time,a.create_time,c.name,c.phone,
w.role_id,w.audit_status AS status,w.operation_status AS operatingStatus,
b.business_status,i.user_id AS i_user_id,ass.emp_id AS ass_user_id,m.emp_id AS m_user_id,
ab.A AS a_user_id,ab.B AS b_user_id
FROM dg_work_conference_consider AS w
LEFT JOIN dg_apply_amount_info AS a ON a.id = w.business_id
LEFT JOIN crms_company_customer AS cc ON a.company_id = cc.id
LEFT JOIN crms_customer AS c ON cc.customer_id = c.id
LEFT JOIN dg_business_process_status AS b ON b.business_id = a.id
LEFT JOIN (SELECT business_id,SUM(CASE role_id WHEN 59 THEN emp_id ELSE 0 END) AS A,
SUM(CASE role_id WHEN 60 THEN emp_id ELSE 0 END) AS B
FROM dg_guarantee_assign_user GROUP BY business_id) AS ab
ON a.id = ab.business_id
LEFT JOIN dg_compliance_investigation AS i ON a.id = i.business_id
LEFT JOIN dg_assets_investigation AS ass ON a.id = ass.business_id
LEFT JOIN dg_message_investigation AS m ON a.id = m.business_id
WHERE c.del_or_not = 0
AND (w.user_id = #{userId} OR w.user_id IS NULL)
AND w.role_id IN
#{roleId}
AND i.role_id = 70
AND ass.role_id = 64
AND m.role_id = 67
AND w.operation_status=1