TextdictInfoMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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="org.springblade.manager.mapper.TextdictInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="textdictInfoResultMap" type="org.springblade.manager.entity.TextdictInfo">
  6. <result column="id" property="id"/>
  7. <result column="is_deleted" property="isDeleted"/>
  8. <result column="name" property="name"/>
  9. <result column="type" property="type"/>
  10. <result column="tab_id" property="tabId"/>
  11. <result column="col_key" property="colKey"/>
  12. <result column="sig_role_id" property="sigRoleId"/>
  13. <result column="is_deleted" property="isDeleted"/>
  14. <result column="col_name" property="colName"/>
  15. <result column="sig_role_name" property="sigRoleName"/>
  16. <result column="pyzbx" property="pyzbx"/>
  17. <result column="pyzby" property="pyzby"/>
  18. <result column="excel_id" property="excelId"/>
  19. <result column="project_id" property="projectId"/>
  20. <result column="time_state" property="timeState"/>
  21. <result column="time_name" property="timeName"/>
  22. <result column="time_col_key" property="timeColKey"/>
  23. </resultMap>
  24. <select id="selectTextdictInfoPage" resultMap="textdictInfoResultMap">
  25. select distinct * from m_textdict_info where is_deleted = 0
  26. <if test="param2.type== 2 ">
  27. and type in('2','6') and (tab_id=#{param2.tabId} or excel_id=#{param2.excelId})
  28. </if>
  29. <if test="param2.type!= 2 ">
  30. and type =#{param2.type} and tab_id=#{param2.tabId}
  31. </if>
  32. <if test="param2.projectId!=null and param2.projectId!='' ">
  33. and project_id=#{param2.projectId}
  34. </if>
  35. </select>
  36. <select id="selectTextdictInfoById" resultType="org.springblade.manager.vo.TextdictInfoVO">
  37. select *,(SELECT parent_id from blade_role c where c.id=b.sig_role_id) as parentRoleId from m_textdict_info b where is_deleted = 0 and id=#{id}
  38. </select>
  39. <select id="selectTextdictInfoByExcelId" resultMap="textdictInfoResultMap">
  40. SELECT a.* from m_textdict_info a,
  41. (select tab_id,count(1) from m_textdict_info where is_deleted = 0 and type in('2','6') and excel_id=#{param2.excelId} GROUP BY tab_id ORDER BY count(tab_id) desc LIMIT 1) b
  42. where a.tab_id=b.tab_id and a.is_deleted = 0 and a.type in('2','6') and a.excel_id=#{param2.excelId}
  43. </select>
  44. <select id="selectTextdictBYIds" resultMap="textdictInfoResultMap">
  45. SELECT a.* from m_textdict_info a
  46. where project_id=#{projectId} and id in
  47. <foreach collection="ids" item="id" open="(" close=")" separator=",">
  48. #{id}
  49. </foreach>
  50. </select>
  51. <select id="selectTextdictInfoOne" resultMap="textdictInfoResultMap">
  52. select * from m_textdict_info where is_deleted = 0
  53. and id= #{id}
  54. and sig_role_id = #{sigRoleId}
  55. and project_id= #{projectId}
  56. </select>
  57. </mapper>