java110
2022-01-17 48c9414db4b7c44a43524115570796025d38a653
java110-db/src/main/resources/mapper/fee/MeterTypeV1ServiceDaoImplMapper.xml
@@ -5,93 +5,89 @@
<mapper namespace="meterTypeV1ServiceDaoImpl">
    <!-- 保存抄表类型信息 add by wuxw 2018-07-03 -->
    <insert id="saveMeterTypeInfo" parameterType="Map">
        insert into meter_type(
type_name,type_id,remark,community_id
) values (
#{typeName},#{typeId},#{remark},#{communityId}
)
        type_name,type_id,remark,community_id
        ) values (
        #{typeName},#{typeId},#{remark},#{communityId}
        )
    </insert>
    <!-- 查询抄表类型信息 add by wuxw 2018-07-03 -->
    <select id="getMeterTypeInfo" parameterType="Map" resultType="Map">
        select  t.type_name,t.type_name typeName,t.type_id,t.type_id typeId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId
from meter_type t
where 1 =1
<if test="typeName !=null and typeName != ''">
   and t.type_name= #{typeName}
</if>
<if test="typeId !=null and typeId != ''">
   and t.type_id= #{typeId}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
        select t.type_name,t.type_name typeName,t.type_id,t.type_id typeId,t.remark,t.status_cd,t.status_cd
        statusCd,t.community_id,t.community_id communityId,t.create_time createTime
        from meter_type t
        where 1 =1
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
        </if>
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改抄表类型信息 add by wuxw 2018-07-03 -->
    <update id="updateMeterTypeInfo" parameterType="Map">
        update  meter_type t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="typeName !=null and typeName != ''">
, t.type_name= #{typeName}
</if>
<if test="remark !=null and remark != ''">
, t.remark= #{remark}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
 where 1=1 <if test="typeId !=null and typeId != ''">
and t.type_id= #{typeId}
</if>
        update meter_type t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="typeName !=null and typeName != ''">
            , t.type_name= #{typeName}
        </if>
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        where 1=1
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
        </if>
    </update>
    <!-- 查询抄表类型数量 add by wuxw 2018-07-03 -->
     <select id="queryMeterTypesCount" parameterType="Map" resultType="Map">
        select  count(1) count
from meter_type t
where 1 =1
<if test="typeName !=null and typeName != ''">
   and t.type_name= #{typeName}
</if>
<if test="typeId !=null and typeId != ''">
   and t.type_id= #{typeId}
</if>
<if test="remark !=null and remark != ''">
   and t.remark= #{remark}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
    <select id="queryMeterTypesCount" parameterType="Map" resultType="Map">
        select count(1) count
        from meter_type t
        where 1 =1
        <if test="typeName !=null and typeName != ''">
            and t.type_name= #{typeName}
        </if>
        <if test="typeId !=null and typeId != ''">
            and t.type_id= #{typeId}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
     </select>
    </select>
</mapper>