SysManualMapper.xml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.yonge.cooleshow.biz.dal.dao.SysManualDao">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.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_,
  17. update_time_, operator_id_
  18. </sql>
  19. <insert id="insertBatch" keyColumn="id_" keyProperty="id"
  20. useGeneratedKeys="true" parameterType="com.yonge.cooleshow.biz.dal.entity.SysManual">
  21. insert into sys_manual(menu_id_, name_, op_flow_, fun_rule_,
  22. video_url_, create_time_, update_time_, operator_id_)
  23. values
  24. <foreach collection="entities" item="entity" separator=",">
  25. (#{entity.menuId}, #{entity.name}, #{entity.opFlow},
  26. #{entity.funRule}, #{entity.videoUrl}, #{entity.createTime},
  27. #{entity.updateTime}, #{entity.operatorId})
  28. </foreach>
  29. </insert>
  30. <select id="findRecordCount" resultType="java.lang.Integer">
  31. select count(1) from sys_manual sm
  32. left join sys_user u on sm.operator_id_ = u.id_
  33. left join sys_menu m on sm.menu_id_ = m.id_
  34. <where>
  35. 1 = 1
  36. <if test="menuId != null and menuId != '' ">
  37. AND menu_id_ = #{menuId}
  38. </if>
  39. <if test="search != null and search != '' ">
  40. AND (sm.name_ like concat('%', #{search} '%') )
  41. </if>
  42. </where>
  43. <include refid="global.limit" />
  44. </select>
  45. <select id="queryRecord" resultType="com.yonge.cooleshow.biz.dal.entity.SysManual">
  46. select sm.*
  47. , u.username_ as operatorName
  48. , m.name_ as menuName
  49. from sys_manual sm
  50. left join sys_user u on sm.operator_id_ = u.id_
  51. left join sys_menu m on sm.menu_id_ = m.id_
  52. <where>
  53. 1 = 1
  54. <if test="menuId != null and menuId != '' ">
  55. AND sm.menu_id_ = #{menuId}
  56. </if>
  57. <if test="search != null and search != '' ">
  58. AND (sm.name_ like concat('%', #{search} '%') )
  59. </if>
  60. </where>
  61. <include refid="global.limit" />
  62. </select>
  63. <select id="listMenuIds" resultType="java.lang.String">
  64. select menu_id_ from sys_manual
  65. </select>
  66. <select id="query" resultType="com.yonge.cooleshow.biz.dal.vo.SysManualVo">
  67. select sm.*
  68. , u.username_ as operatorName
  69. , m.name_ as menuName
  70. from sys_manual sm
  71. left join sys_user u on sm.operator_id_ = u.id_
  72. left join sys_menu m on sm.menu_id_ = m.id_
  73. <where>
  74. <if test="param.menuId != null">
  75. AND sm.menu_id_ = #{param.menuId}
  76. </if>
  77. <if test="param.status != null">
  78. AND sm.status_ = #{param.status}
  79. </if>
  80. <if test="param.title != null and param.title != ''">
  81. and sm.name_ like concat('%',#{param.title},'%')
  82. </if>
  83. </where>
  84. </select>
  85. </mapper>