ConfigMapper.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.zcxk.smartcity.data.access.dao.ConfigMapper">
  4. <!--auto generated Code-->
  5. <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.Config">
  6. <result column="id" property="id" jdbcType="INTEGER"/>
  7. <result column="config_name" property="configName" jdbcType="VARCHAR"/>
  8. <result column="config_value" property="configValue" jdbcType="VARCHAR"/>
  9. <result column="config_desc" property="configDesc" jdbcType="VARCHAR"/>
  10. <result column="parent_id" property="parentId" jdbcType="INTEGER"/>
  11. <result column="status" property="status" jdbcType="TINYINT"/>
  12. <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
  13. <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
  14. <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
  15. <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
  16. </resultMap>
  17. <!--auto generated Code-->
  18. <sql id="Base_Column_List">
  19. id,
  20. config_name,
  21. config_value,
  22. config_desc,
  23. parent_id,
  24. status,
  25. create_by,
  26. update_by,
  27. date_create,
  28. date_update
  29. </sql>
  30. <select id="findByParentId" resultType="com.zcxk.smartcity.data.access.dto.ConfigDataDto">
  31. select config_name as `name`,config_value as `value`
  32. from sc_config_t where status = 1 and parent_id = #{parentId} order by config_value asc
  33. </select>
  34. <select id="findByName" resultMap="BaseResultMap">
  35. select <include refid="Base_Column_List"/> from sc_config_t
  36. where status = 1 and config_name = #{name}
  37. </select>
  38. <select id="findByValue" resultMap="BaseResultMap">
  39. select <include refid="Base_Column_List"/> from sc_config_t
  40. where status = 1 and config_value = #{value}
  41. </select>
  42. </mapper>