BustripProjectMapper.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  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.management.platform.mapper.BustripProjectMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.management.platform.entity.BustripProject">
  6. <id column="id" property="id" />
  7. <result column="bustrip_id" property="bustripId" />
  8. <result column="project_id" property="projectId" />
  9. <result column="start_date" property="startDate" />
  10. <result column="end_date" property="endDate" />
  11. <result column="degree_id" property="degreeId" />
  12. <result column="degree_name" property="degreeName" />
  13. </resultMap>
  14. <!-- 通用查询结果列 -->
  15. <sql id="Base_Column_List">
  16. id, bustrip_id, project_id, start_date, end_date, degree_id, degree_name
  17. </sql>
  18. <select id="getByDate" resultType="com.management.platform.entity.BustripProject">
  19. select bp.*
  20. from bustrip_project bp
  21. left join business_trip bt on bp.bustrip_id = bt.id
  22. where bt.owner_id = #{userId}
  23. and bp.start_date &lt; str_to_date(#{date},'%Y-%m-%d')
  24. and bp.end_date &gt; str_to_date(#{date},'%Y-%m-%d')
  25. </select>
  26. </mapper>