ContractsMapper.xml 3.8 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="cn.com.ty.lift.business.contract.dao.mapper.ContractsMapper" >
  4. <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.contract.dao.entity.Contracts" >
  5. <id column="id" property="id" jdbcType="BIGINT" />
  6. <result column="project_id" property="projectId" jdbcType="BIGINT" />
  7. <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
  8. <result column="code" property="code" jdbcType="VARCHAR" />
  9. <result column="source" property="source" jdbcType="INTEGER" />
  10. <result column="pay_mode" property="payMode" jdbcType="VARCHAR" />
  11. <result column="lift_num" property="liftNum" jdbcType="INTEGER" />
  12. <result column="moneys" property="moneys" jdbcType="DECIMAL" />
  13. <result column="type" property="type" jdbcType="INTEGER" />
  14. <result column="status" property="status" jdbcType="INTEGER" />
  15. <result column="given_date" property="givenDate" jdbcType="TIMESTAMP" />
  16. <result column="given_user" property="givenUser" jdbcType="VARCHAR" />
  17. <result column="star_date" property="starDate" jdbcType="TIMESTAMP" />
  18. <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
  19. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  20. <result column="next_id" property="nextId" jdbcType="BIGINT" />
  21. <result column="accessory_url" property="accessoryUrl" jdbcType="LONGVARCHAR" />
  22. <result column="end_reason" property="endReason" jdbcType="LONGVARCHAR" />
  23. <result column="remarks" property="remarks" jdbcType="LONGVARCHAR" />
  24. <result column="previous_id" property="previousId" jdbcType="BIGINT" />
  25. </resultMap>
  26. <sql id="Base_Column_List" >
  27. id, project_id, mt_company_id, code, source, pay_mode, lift_num, moneys, type, status,
  28. given_date, given_user, star_date, end_date, create_date, next_id, previous_id, accessory_url, end_reason, remarks
  29. </sql>
  30. <!-- 根据项目、合同号、合同类型、合同状态查询合同管理列表-->
  31. <select id="findByCondition" resultType="cn.com.ty.lift.business.contract.dao.entity.model.ContractResponse"
  32. parameterType="cn.com.ty.lift.business.contract.dao.entity.model.ContractRequest" >
  33. SELECT
  34. c.id AS id,
  35. c.code AS contractCode,
  36. c.next_id AS nextId,
  37. c.source AS contractSource,
  38. c.type AS contractType,
  39. c.star_date AS starDate,
  40. c.end_date AS endDate,
  41. c.lift_num AS liftNum,
  42. c.moneys AS moneys,
  43. c.given_date AS givenDate,
  44. c.given_user AS givenUser,
  45. c.accessory_url AS accessoryUrl,
  46. c.remarks AS remarks,
  47. c.status AS contractStatus,
  48. p.project_name AS projectName
  49. FROM contracts c
  50. LEFT JOIN project p ON c.project_id = p.id
  51. WHERE c.mt_company_id = #{request.mtCompanyId,jdbcType=BIGINT}
  52. <if test="request.contractId!=null and request.contractId!=''">
  53. AND c.next_id LIKE #{request.contractId,jdbcType=BIGINT}
  54. </if>
  55. <if test="request.contractType!=null and request.contractType!=''">
  56. AND c.type = #{request.contractType,jdbcType=INTEGER}
  57. </if>
  58. <if test="request.contractStatus!=null and request.contractStatus!=''">
  59. AND c.status = #{request.contractStatus,jdbcType=INTEGER}
  60. </if>
  61. <if test="request.projectName!=null and request.projectName!=''">
  62. AND p.project_name LIKE #{request.projectName,jdbcType=VARCHAR}
  63. </if>
  64. </select>
  65. </mapper>