12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.imed.costaccount.mapper.ShareParamValueMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.imed.costaccount.model.ShareParamValue" id="shareParamValueMap">
- <result property="id" column="id"/>
- <result property="dateYear" column="date_year"/>
- <result property="dateMonth" column="date_month"/>
- <result property="shareParamCode" column="share_param_code"/>
- <result property="responsibilityCode" column="responsibility_code"/>
- <result property="valueNum" column="value_num"/>
- <result property="hospId" column="hosp_id"/>
- <result property="fileId" column="fileId"/>
- <result property="dataSourceType" column="data_source_type"/>
- <result property="createTime" column="create_time"/>
- <result property="deleteTime" column="delete_time"/>
- </resultMap>
- <select id="getValues" resultType="com.imed.costaccount.model.dto.ShareParamValueVO">
- select cspv.*, csp.share_param_name, cr.responsibility_name
- from cost_share_param_value cspv
- left join cost_share_param csp
- on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
- left join cost_responsibility cr
- on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
- where cspv.hosp_id = #{hospId}
- and cspv.delete_time = 0
- and csp.delete_time = 0
- and cr.delete_time = 0
- and cspv.date_month = month(#{date})
- and cspv.date_year = year(#{date})
- <if test="shareParamCode != null and shareParamCode != ''">
- and cspv.share_param_code = #{shareParamCode}
- </if>
- <if test="responsibilityCode != null and responsibilityCode != ''">
- and cspv.responsibility_code = #{responsibilityCode}
- </if>
- limit #{current},#{pageSize}
- </select>
- <select id="getValuesCount" resultType="java.lang.Integer">
- select count(*)
- from cost_share_param_value cspv
- left join cost_share_param csp
- on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
- left join cost_responsibility cr
- on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
- where cspv.hosp_id = #{hospId}
- and cspv.delete_time = 0
- and csp.delete_time = 0
- and cr.delete_time = 0
- and cspv.date_month = month(#{date})
- and cspv.date_year = year(#{date})
- <if test="shareParamCode != null and shareParamCode != ''">
- and cspv.share_param_code = #{shareParamCode}
- </if>
- <if test="responsibilityCode != null and responsibilityCode != ''">
- and cspv.responsibility_code = #{responsibilityCode}
- </if>
- </select>
- </mapper>
|