HandleMattersDao.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.example.nngkxxdp.dao.HandleMattersDao">
  6. <resultMap id="BaseResultMap" type="com.example.nngkxxdp.entity.HandleMatters">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="mattersName" column="matters_name" jdbcType="VARCHAR"/>
  9. <result property="windowNum" column="window_num" jdbcType="VARCHAR"/>
  10. <result property="deptId" column="deptId" jdbcType="INTEGER"/>
  11. <result property="url" column="url" jdbcType="VARCHAR"/>
  12. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  13. <association property="handleDept" javaType="com.example.nngkxxdp.entity.HandleDept">
  14. <result column="id" property="id"/>
  15. <result column="dept_name" property="deptName"/>
  16. </association>
  17. </resultMap>
  18. <sql id="Base_Column_List">
  19. id,matters_name,window_num,
  20. deptId,create_time
  21. </sql>
  22. <select id="findById" resultType="com.example.nngkxxdp.entity.HandleMatters">
  23. select hm.id,hm.matters_name,hm.window_num,hm.url from t_handle_matters hm
  24. where hm.deptId=#{deptId}
  25. </select>
  26. <select id="queryCount" resultType="int">
  27. select count(*) from t_handle_matters hm
  28. where hm.deptId=#{deptId}
  29. </select>
  30. <select id="queryData" resultType="com.example.nngkxxdp.entity.HandleMatters">
  31. select hm.id,hm.matters_name,hm.window_num from t_handle_matters hm
  32. where hm.deptId=#{deptId}
  33. limit #{offset}, #{limit}
  34. </select>
  35. <!--事项清单模糊查询-->
  36. <select id="findBykey" resultType="com.example.nngkxxdp.entity.HandleMatters">
  37. select * from t_handle_matters
  38. where matters_name like concat('%',#{keyword},'%')
  39. LIMIT #{offset}, #{pageSize}
  40. </select>
  41. <select id="queryCountBykey" resultType="java.lang.Integer">
  42. select count(*) from t_handle_matters
  43. where matters_name like concat('%',#{keyword},'%')
  44. </select>
  45. <select id="findByKeyAll" resultType="com.example.nngkxxdp.entity.HandleMatters">
  46. select * from t_handle_matters
  47. where matters_name like concat('%',#{keyword},'%')
  48. </select>
  49. <select id="findByIdByKey" resultType="com.example.nngkxxdp.entity.HandleMatters">
  50. select * from t_handle_matters
  51. where deptId=#{deptId}
  52. <if test="keyword != null and keyword != ''">
  53. and matters_name like concat('%', #{keyword}, '%')
  54. </if>
  55. </select>
  56. <select id="findByIdByKeyCount" resultType="java.lang.Integer">
  57. select count(*) from t_handle_matters
  58. where deptId=#{deptId}
  59. <if test="keyword != null and keyword != ''">
  60. and matters_name like concat('%', #{keyword}, '%')
  61. </if>
  62. </select>
  63. </mapper>