CbContactUsMapper.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.hjy.module.mapper.portal.CbContactUsMapper">
  6. <sql id="querySql">
  7. select <include refid="allField"/>
  8. from CB_CONTACT_US A
  9. <include refid="search"/>
  10. </sql>
  11. <select id="queryList" resultType="com.hjy.module.vo.portal.CbContactUsVo">
  12. <include refid="querySql"/>
  13. <if test="entity.id != null and entity.id != ''">
  14. and A.ID like concat('%', #{entity.id}, '%')
  15. </if>
  16. <if test="entity.createTime != null and entity.createTime != ''">
  17. and A.CREATE_TIME like concat('%', #{entity.createTime}, '%')
  18. </if>
  19. <if test="entity.createBy != null and entity.createBy != ''">
  20. and A.CREATE_BY like concat('%', #{entity.createBy}, '%')
  21. </if>
  22. <if test="entity.updateTime != null and entity.updateTime != ''">
  23. and A.UPDATE_TIME like concat('%', #{entity.updateTime}, '%')
  24. </if>
  25. <if test="entity.updateBy != null and entity.updateBy != ''">
  26. and A.UPDATE_BY like concat('%', #{entity.updateBy}, '%')
  27. </if>
  28. <if test="entity.delFlag != null and entity.delFlag != ''">
  29. and A.DEL_FLAG like concat('%', #{entity.delFlag}, '%')
  30. </if>
  31. <if test="entity.deptId != null and entity.deptId != ''">
  32. and A.DEPT_ID like concat('%', #{entity.deptId}, '%')
  33. </if>
  34. <if test="entity.depName != null and entity.depName != ''">
  35. and A.DEP_NAME like concat('%', #{entity.depName}, '%')
  36. </if>
  37. <if test="entity.telphone != null and entity.telphone != ''">
  38. and A.TELPHONE like concat('%', #{entity.telphone}, '%')
  39. </if>
  40. <if test="entity.location != null and entity.location != ''">
  41. and A.LOCATION like concat('%', #{entity.location}, '%')
  42. </if>
  43. <if test="entity.email != null and entity.email != ''">
  44. and A.EMAIL like concat('%', #{entity.email}, '%')
  45. </if>
  46. order by A.create_time DESC
  47. <if test="num == 1">
  48. LIMIT 1
  49. </if>
  50. </select>
  51. <select id="queryById" resultType="com.hjy.module.vo.portal.CbContactUsVo">
  52. <include refid="querySql"/>
  53. and A.id = #{id}
  54. </select>
  55. <sql id="allField">
  56. A.ID,
  57. A.CREATE_TIME,
  58. A.CREATE_BY,
  59. A.UPDATE_TIME,
  60. A.UPDATE_BY,
  61. A.DEL_FLAG,
  62. A.DEPT_ID,
  63. A.DEP_NAME,
  64. A.TELPHONE,
  65. A.LOCATION,
  66. A.EMAIL
  67. </sql>
  68. <sql id="search">
  69. where A.del_flag = 0
  70. </sql>
  71. </mapper>