Commit 58fbe27a authored by 刘子正's avatar 刘子正

BCompany删除接口 sql语句修改

parent 0945809f
......@@ -209,12 +209,24 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
* @param businessId
* @return
*/
@Delete("DELETE sr " +
"FROM" +
"s_r_user_role sr " +
"LEFT JOIN s_user s on s.business_id = sr.user_id " +
"LEFT JOIN ${tb} c ON c. CODE = s.login_name " +
"WHERE" +
"c.business_id = #{cid}")
@Delete("DELETE\n" +
"FROM\n" +
"\ts_r_user_role\n" +
"WHERE\n" +
"\ts_r_user_role.business_id = (\n" +
"\t\tSELECT\n" +
"\t\t\tab.*\n" +
"\t\tFROM\n" +
"\t\t\t(\n" +
"\t\t\t\tSELECT\n" +
"\t\t\t\t\ts_r_user_role.business_id\n" +
"\t\t\t\tFROM\n" +
"\t\t\t\t\ts_r_user_role\n" +
"\t\t\t\tLEFT JOIN s_user ON s_r_user_role.user_id = s_user.business_id\n" +
"\t\t\t\tLEFT JOIN ${tb} ON ${tb}.`code` = s_user.login_name\n" +
"\t\t\t\tWHERE\n" +
"\t\t\t\t\t${tb}.business_id = #{cid}\n" +
"\t\t\t) ab\n" +
"\t)")
int deleteUserRoleByChildrenId(@Param("tb") String tableByKey,@Param("cid") String businessId);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment