MxjbOperationManualMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.mingxue.mapper.MxjbOperationManualMapper">
  6. <resultMap type="MxjbOperationManual" id="MxjbOperationManualResult">
  7. <result property="id" column="id" />
  8. <result property="parentId" column="parent_id" />
  9. <result property="ancestors" column="ancestors" />
  10. <result property="name" column="name" />
  11. <result property="nameType" column="name_type" />
  12. <result property="aliId" column="aliId" />
  13. <result property="source" column="source" />
  14. <result property="fileSize" column="file_size" />
  15. <result property="duration" column="duration" />
  16. <result property="coverUrl" column="cover_url" />
  17. <result property="roleIds" column="role_ids" />
  18. <result property="sort" column="sort" />
  19. <result property="createTime" column="create_time" />
  20. <result property="status" column="status" />
  21. <result property="updateTime" column="update_time" />
  22. </resultMap>
  23. <sql id="selectMxjbOperationManualVo">
  24. select id, parent_id, ancestors, name, name_type, aliId, source, file_size, duration, cover_url, role_ids, sort, create_time, status, update_time from mxjb_operation_manual
  25. </sql>
  26. <select id="selectMxjbOperationManualList" parameterType="MxjbOperationManual" resultMap="MxjbOperationManualResult">
  27. <include refid="selectMxjbOperationManualVo"/>
  28. <where>
  29. <if test="parentId != null "> and parent_id = #{parentId}</if>
  30. <if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
  31. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  32. <if test="nameType != null and nameType != ''"> and name_type = #{nameType}</if>
  33. <if test="aliId != null and aliId != ''"> and aliId = #{aliId}</if>
  34. <if test="source != null and source != ''"> and find_in_set(#{source}, source)</if>
  35. <if test="fileSize != null "> and file_size = #{fileSize}</if>
  36. <if test="duration != null "> and duration = #{duration}</if>
  37. <if test="coverUrl != null and coverUrl != ''"> and cover_url = #{coverUrl}</if>
  38. <if test="roleIds != null and roleIds != ''"> and find_in_set(#{roleIds}, role_ids)</if>
  39. <if test="sort != null "> and sort = #{sort}</if>
  40. <if test="status != null "> and status = #{status}</if>
  41. <if test="status == null "> and status >0</if>
  42. </where>
  43. </select>
  44. <select id="selectMxjbOperationManualByNameType" parameterType="String" resultMap="MxjbOperationManualResult">
  45. <include refid="selectMxjbOperationManualVo"/>
  46. where status >0 and name_type = #{nameType}
  47. </select>
  48. <select id="selectMxjbOperationManualAndChildren" parameterType="MxjbOperationManual" resultMap="MxjbOperationManualResult">
  49. <include refid="selectMxjbOperationManualVo"/>
  50. where status >0
  51. and (id = #{id} OR id IN (
  52. SELECT t.id FROM mxjb_operation_manual t WHERE find_in_set(#{id}, ancestors)
  53. <if test="source != null and source != ''"> and source like concat('%', #{source}, '%')</if>
  54. <if test="roleIds != null and roleIds != ''"> and role_ids like concat('%', #{roleIds}, '%')</if>
  55. )
  56. )
  57. </select>
  58. <select id="selectMxjbOperationManualById" parameterType="Long" resultMap="MxjbOperationManualResult">
  59. <include refid="selectMxjbOperationManualVo"/>
  60. where id = #{id}
  61. </select>
  62. <insert id="insertMxjbOperationManual" parameterType="MxjbOperationManual" useGeneratedKeys="true" keyProperty="id">
  63. insert into mxjb_operation_manual
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test="parentId != null">parent_id,</if>
  66. <if test="ancestors != null">ancestors,</if>
  67. <if test="name != null">name,</if>
  68. <if test="nameType != null">name_type,</if>
  69. <if test="aliId != null">aliId,</if>
  70. <if test="source != null">source,</if>
  71. <if test="fileSize != null">file_size,</if>
  72. <if test="duration != null">duration,</if>
  73. <if test="coverUrl != null">cover_url,</if>
  74. <if test="roleIds != null and roleIds != ''">role_ids,</if>
  75. <if test="sort != null">sort,</if>
  76. <if test="createTime != null">create_time,</if>
  77. <if test="status != null">status,</if>
  78. <if test="updateTime != null">update_time,</if>
  79. </trim>
  80. <trim prefix="values (" suffix=")" suffixOverrides=",">
  81. <if test="parentId != null">#{parentId},</if>
  82. <if test="ancestors != null">#{ancestors},</if>
  83. <if test="name != null">#{name},</if>
  84. <if test="nameType != null">#{nameType},</if>
  85. <if test="aliId != null">#{aliId},</if>
  86. <if test="source != null">#{source},</if>
  87. <if test="fileSize != null">#{fileSize},</if>
  88. <if test="duration != null">#{duration},</if>
  89. <if test="coverUrl != null">#{coverUrl},</if>
  90. <if test="roleIds != null and roleIds != ''">#{roleIds},</if>
  91. <if test="sort != null">#{sort},</if>
  92. <if test="createTime != null">#{createTime},</if>
  93. <if test="status != null">#{status},</if>
  94. <if test="updateTime != null">#{updateTime},</if>
  95. </trim>
  96. </insert>
  97. <update id="updateMxjbOperationManual" parameterType="MxjbOperationManual">
  98. update mxjb_operation_manual
  99. <trim prefix="SET" suffixOverrides=",">
  100. <if test="parentId != null">parent_id = #{parentId},</if>
  101. <if test="ancestors != null">ancestors = #{ancestors},</if>
  102. <if test="name != null">name = #{name},</if>
  103. <if test="nameType != null">name_type = #{nameType},</if>
  104. <if test="aliId != null">aliId = #{aliId},</if>
  105. <if test="source != null">source = #{source},</if>
  106. <if test="fileSize != null">file_size = #{fileSize},</if>
  107. <if test="duration != null">duration = #{duration},</if>
  108. <if test="coverUrl != null">cover_url = #{coverUrl},</if>
  109. <if test="roleIds != null and roleIds != ''">role_ids = #{roleIds},</if>
  110. <if test="sort != null">sort = #{sort},</if>
  111. <if test="createTime != null">create_time = #{createTime},</if>
  112. <if test="status != null">status = #{status},</if>
  113. <if test="updateTime != null">update_time = #{updateTime},</if>
  114. </trim>
  115. where id = #{id}
  116. </update>
  117. <delete id="deleteMxjbOperationManualById" parameterType="Long">
  118. delete from mxjb_operation_manual where id = #{id}
  119. </delete>
  120. <delete id="deleteMxjbOperationManualByIds" parameterType="String">
  121. delete from mxjb_operation_manual where id in
  122. <foreach item="id" collection="array" open="(" separator="," close=")">
  123. #{id}
  124. </foreach>
  125. </delete>
  126. </mapper>