CostDocumentTemplateFileMapper.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.hotent.baseInfo.dao.CostDocumentTemplateFileDao">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.hotent.baseInfo.model.CostDocumentTemplateFile">
  6. <id column="id" property="id" />
  7. <result column="original_text" property="originalText" />
  8. <result column="pinyin" property="pinyin" />
  9. <result column="document_id" property="documentId" />
  10. <result column="label_value" property="labelValue" />
  11. <result column="table_name" property="tableName" />
  12. <result column="col_name" property="colName" />
  13. <result column="where_name" property="whereName"/>
  14. <result column="where_value" property="whereValue"/>
  15. <result column="status" property="status" />
  16. <result column="is_deleted" property="isDeleted" />
  17. <result column="create_time" property="createTime" />
  18. <result column="create_by" property="createBy" />
  19. <result column="update_time" property="updateTime" />
  20. <result column="update_by" property="updateBy" />
  21. <result column="remark" property="remark" />
  22. </resultMap>
  23. <!-- 通用查询结果列 -->
  24. <sql id="Base_Column_List">
  25. id, original_text, pinyin, document_id, where_name,where_value, label_value, table_name, col_name, status, is_deleted, create_time, create_by, update_time, update_by, remark
  26. </sql>
  27. <select id="selectPage" resultMap="BaseResultMap">
  28. select
  29. <include refid="Base_Column_List"/>
  30. from
  31. cost_document_template_file
  32. ${ew.customSqlSegment}
  33. </select>
  34. <select id="selectList" resultMap="BaseResultMap">
  35. select
  36. <include refid="Base_Column_List"/>
  37. from
  38. cost_document_template_file
  39. ${ew.customSqlSegment}
  40. </select>
  41. <select id="selectById" resultMap="BaseResultMap">
  42. select
  43. <include refid="Base_Column_List"/>
  44. from
  45. cost_document_template_file
  46. where
  47. id = ${id}
  48. </select>
  49. <select id="tableExists" resultType="java.lang.Integer">
  50. select count(1) from information_schema.columns where table_name = #{tableName}
  51. </select>
  52. <select id="colExists" resultType="java.lang.Integer">
  53. select count(1) from information_schema.columns where table_name = #{tableName} and column_name = #{colName}
  54. </select>
  55. <select id="getColValue" resultType="java.lang.String">
  56. select
  57. ${colName}
  58. from
  59. ${tableName}
  60. where
  61. ${whereName} = ${whereValue}
  62. </select>
  63. </mapper>