|
@@ -0,0 +1,45 @@
|
|
|
+package com.bofeng.dao;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.mapper.BaseMapper;
|
|
|
+import com.bofeng.entity.EpiAdmin;
|
|
|
+import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+import org.springframework.stereotype.Repository;
|
|
|
+
|
|
|
+@Mapper
|
|
|
+@Repository
|
|
|
+public interface EpiAdminMapper extends BaseMapper<EpiAdmin> {
|
|
|
+
|
|
|
+ @Select(
|
|
|
+ "insert into tp_user\n" +
|
|
|
+ "(select ur.user_id,u.uptown_id,aa.linkman,aa.phone,now(),now() from sys_user_role ur\n" +
|
|
|
+ "left join sys_uptown_house up on up.house_id = ur.property_id\n" +
|
|
|
+ "left join sys_uptown_unit uu on uu.unit_id = up.unit_id\n" +
|
|
|
+ "left join sys_uptown u on u.uptown_id = uu.uptown_id\n" +
|
|
|
+ "left join (\n" +
|
|
|
+ "select ur.user_id,up.linkman,up.phone from sys_user_role ur\n" +
|
|
|
+ "left join sys_uptown_home up on up.house_id = ur.property_id\n" +
|
|
|
+ "where ur.role_id = 1 and up.phone = #{we}) aa on aa.user_id = ur.user_id\n" +
|
|
|
+ "where ur.role_id = 1 and ur.user_id = (select user_id from sys_user_role where property_id = (select house_id from sys_uptown_home where phone = #{we}) and role_id = 1))\n"
|
|
|
+ )
|
|
|
+ void step1(@Param("we") String we);
|
|
|
+
|
|
|
+ @Select(
|
|
|
+ "insert into sys_owner\n" +
|
|
|
+ "select (select owner_id from (\n" +
|
|
|
+ "(select ifnull(max(owner_id+0)+1,1) as owner_id from sys_owner)\n" +
|
|
|
+ ") as tmp),uptown_id,linkman,phone,user_id,now(),user_id,now() from tp_user order by time_create desc limit 1;\n"
|
|
|
+ )
|
|
|
+ void step2(@Param("we") String we);
|
|
|
+
|
|
|
+ @Select(
|
|
|
+ "insert into sys_user_role\n" +
|
|
|
+ "select (select ur_id from (\n" +
|
|
|
+ "(select ifnull(max(ur_id+0)+1,1) as ur_id from sys_user_role)\n" +
|
|
|
+ ") as tmp),user_id, 2,\n" +
|
|
|
+ "(select owner_id from sys_owner where user_create = (select user_id from tp_user order by time_create desc limit 1))\n" +
|
|
|
+ ",user_id,now(),user_id,now() from tp_user order by time_create desc limit 1;"
|
|
|
+ )
|
|
|
+ void step3(@Param("we") String we);
|
|
|
+}
|