SysManualMapper.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.ym.mec.biz.dal.dao.SysManualDao">
  4. <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.SysManual">
  5. <id column="id_" jdbcType="INTEGER" property="id"/>
  6. <result column="menu_id_" jdbcType="INTEGER" property="menuId"/>
  7. <result column="name_" jdbcType="VARCHAR" property="name"/>
  8. <result column="op_flow_" jdbcType="VARCHAR" property="opFlow"/>
  9. <result column="fun_rule_" jdbcType="VARCHAR" property="funRule"/>
  10. <result column="video_url_" jdbcType="VARCHAR" property="videoUrl"/>
  11. <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
  12. <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
  13. <result column="operator_id_" jdbcType="INTEGER" property="operatorId"/>
  14. </resultMap>
  15. <sql id="Base_Column_List">
  16. id_, menu_id_, name_, op_flow_, fun_rule_, video_url_, create_time_, update_time_, operator_id_
  17. </sql>
  18. <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
  19. parameterType="com.ym.mec.biz.dal.entity.SysManual">
  20. insert into sys_manual(menu_id_, name_, op_flow_, fun_rule_, video_url_, create_time_, update_time_, operator_id_)
  21. values
  22. <foreach collection="entities" item="entity" separator=",">
  23. (#{entity.menuId}, #{entity.name}, #{entity.opFlow}, #{entity.funRule}, #{entity.videoUrl}, #{entity.createTime}, #{entity.updateTime}, #{entity.operatorId})
  24. </foreach>
  25. </insert>
  26. <select id="findRecordCount" resultType="java.lang.Integer">
  27. select count(1) from sys_manual sm
  28. left join sys_user u on sm.operator_id_ = u.id_
  29. left join sys_menu m on sm.menu_id_ = m.id_
  30. <where>
  31. 1 = 1
  32. <if test="menuId != null and menuId != '' ">
  33. AND menu_id_ = #{menuId}
  34. </if>
  35. <if test="search != null and search != '' ">
  36. AND (sm.name_ like concat('%', #{search} '%') )
  37. </if>
  38. </where>
  39. <include refid="global.limit"/>
  40. </select>
  41. <select id="queryRecord" resultType="com.ym.mec.biz.dal.entity.SysManual">
  42. select sm.*
  43. , u.username_ as operatorName
  44. , m.name_ as menuName
  45. from sys_manual sm
  46. left join sys_user u on sm.operator_id_ = u.id_
  47. left join sys_menu m on sm.menu_id_ = m.id_
  48. <where>
  49. 1 = 1
  50. <if test="menuId != null and menuId != '' ">
  51. AND sm.menu_id_ = #{menuId}
  52. </if>
  53. <if test="search != null and search != '' ">
  54. AND (sm.name_ like concat('%', #{search} '%') )
  55. </if>
  56. </where>
  57. <include refid="global.limit"/>
  58. </select>
  59. <select id="listMenuIds" resultType="java.lang.String">
  60. select menu_id_ from sys_manual
  61. </select>
  62. </mapper>