TheLeadershipDao.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.jeeplus.modules.wexintheorder.dao.TheLeadershipDao">
  4. <sql id="userColumns">
  5. a.id,
  6. a.com_id AS "comId",
  7. a.company_id AS "company.id",
  8. a.office_id AS "office.id",
  9. a.login_name,
  10. a.password,
  11. a.password_remake AS "passwordRemake",
  12. a.no,
  13. a.name,
  14. a.sex,
  15. a.email,
  16. a.phone,
  17. a.mobile,
  18. a.ishide,
  19. a.user_type,
  20. a.login_ip,
  21. a.login_date,
  22. a.remarks,
  23. a.login_flag,
  24. a.photo,
  25. a.default_photo,
  26. a.qrcode,
  27. a.sign,
  28. a.create_by AS "createBy.id",
  29. a.create_date,
  30. a.update_by AS "updateBy.id",
  31. a.update_date,
  32. a.del_flag,
  33. a.first_flag AS "firstFlag",
  34. s.name AS "company.name",
  35. s.parent_id AS "company.parent.id",
  36. s.parent_ids AS "company.parentIds",
  37. s.group_id AS "company.groupId",
  38. s.group_name AS "company.groupName",
  39. s.useable AS "company.useable",
  40. o.name AS "office.name",
  41. o.top_company AS "office.topCompany",
  42. o.parent_id AS "office.parent.id",
  43. o.parent_ids AS "office.parentIds",
  44. bo.id AS "branchOffice.id",
  45. bo.name AS "branchOffice.name",
  46. bo.parent_ids AS "branchOffice.parentIds",
  47. bo.parent_id AS "branchOffice.parent.id"
  48. </sql>
  49. <sql id="leaderShipColumns">
  50. a.id AS "id",
  51. a.create_by AS "createBy.id",
  52. a.create_date AS "createDate",
  53. a.update_by AS "updateBy.id",
  54. a.update_date AS "updateDate",
  55. a.remarks AS "remarks",
  56. a.team AS "team",
  57. a.department AS "department",
  58. a.specific AS "specific",
  59. a.correlationId AS "correlationId"
  60. </sql>
  61. <select id="findListUserId" resultType="com.jeeplus.modules.wexintheorder.entity.TheLeadership">
  62. select
  63. <include refid="leaderShipColumns"/>
  64. from the_order_information a
  65. WHERE a.correlationId = #{correlationId}
  66. </select>
  67. <insert id="insertLeaderShip">
  68. INSERT INTO the_order_information(
  69. id,
  70. create_by,
  71. create_date,
  72. update_by,
  73. update_date,
  74. remarks,
  75. team,
  76. department,
  77. `specific`,
  78. correlationId
  79. ) VALUES (
  80. #{id},
  81. #{createBy.id},
  82. #{createDate},
  83. #{updateBy.id},
  84. #{updateDate},
  85. #{remarks},
  86. #{team},
  87. #{department},
  88. #{specific},
  89. #{correlationId}
  90. )
  91. </insert>
  92. <update id="updateLeaderShip">
  93. UPDATE the_order_information SET
  94. update_date = #{updateDate},
  95. team = #{team},
  96. department = #{department},
  97. `specific` = #{specific}
  98. WHERE correlationId = #{correlationId}
  99. </update>
  100. <select id="findUser" resultType="com.jeeplus.modules.sys.entity.User">
  101. SELECT a.id,a.name from sys_user a WHERE a.name = #{name}
  102. </select>
  103. <!-- 根据id查找部门分管领导信息 -->
  104. <!--<select id="findUser" resultType="com.jeeplus.modules.sys.entity.User">-->
  105. <!--SELECT-->
  106. <!--<include refid="userColumns"/>-->
  107. <!--FROM sys_user a-->
  108. <!--LEFT JOIN sys_user_office uo ON uo.user_id = a.id AND uo.company_id = #{companyId} AND uo.status = '3' AND uo.del_flag = '0'-->
  109. <!--LEFT JOIN sys_office s ON s.id = uo.company_id-->
  110. <!--LEFT JOIN sys_office o ON o.id = uo.office_id-->
  111. <!--LEFT JOIN sys_office bo ON bo.id = o.branch_office-->
  112. <!--WHERE a.name = #{name}-->
  113. <!--</select>-->
  114. <select id="findOffice" resultType="java.lang.String">
  115. select o.name from sys_office o where id = #{id}
  116. </select>
  117. </mapper>