|
@@ -31,6 +31,8 @@
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
<result property="isDel" column="is_del"/>
|
|
|
+ <result property="hjh" column="hjh"/>
|
|
|
+
|
|
|
|
|
|
<!--以下是返回是需要使用-->
|
|
|
<result property="phoneNum" column="phone_num"/>
|
|
@@ -192,8 +194,67 @@
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getExport" resultMap="AccountingDataResult">
|
|
|
+ <select id="getExportHj" resultMap="AccountingDataResult">
|
|
|
+ SELECT
|
|
|
+ r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
|
|
|
+ r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,
|
|
|
+ d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
|
|
|
+ z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
|
|
|
+ villageXjd,z.now_in
|
|
|
+ FROM czrk r
|
|
|
+ left join czrk_jzdz z on r.id =z.czrk_id
|
|
|
+ left join `accounting_data` d on r.id_card = d.zjhm
|
|
|
+ <where>
|
|
|
+ r.is_del = 'N'
|
|
|
+ and r.status = '1'
|
|
|
+ <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
|
|
|
+ <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
|
|
|
+ <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
|
|
|
+ DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
|
|
|
+ DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="isNucleicAcid != null and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
|
|
|
+ <if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
|
|
|
+ <if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
|
|
|
+ <if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
|
|
|
+ <if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
|
|
|
+ <if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
|
|
|
+ </where>
|
|
|
+ order by d.cjsj DESC,r.create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
+ <select id="exportCz" resultMap="AccountingDataResult">
|
|
|
+ select
|
|
|
+ r.id,r.user_name as xm,r.id_card as zjhm,r.code as hjh,r.is_nucleicAcid as isNucleicAcid,
|
|
|
+ r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,
|
|
|
+ d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj,
|
|
|
+ z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as
|
|
|
+ villageXjd,z.now_in
|
|
|
+ from czrk r
|
|
|
+ left join czrk_jzdz z on r.id =z.czrk_id
|
|
|
+ left join `accounting_data` d on r.id_card = d.zjhm
|
|
|
+ <where>
|
|
|
+ r.is_del = 'N'
|
|
|
+ and r.status = '1'
|
|
|
+ <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
|
|
|
+ <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
|
|
|
+ <if test="params.startTime != null and params.startTime != '' and params.startTime != 'null'">and
|
|
|
+ DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != '' and params.endTime != 'null'">and
|
|
|
+ DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="isNucleicAcid != null and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
|
|
|
+ <if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
|
|
|
+ <if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
|
|
|
+ <if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
|
|
|
+ <if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
|
|
|
+ <if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
|
|
|
+ </where>
|
|
|
+ order by d.cjsj DESC,r.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getAccountingDataOne" resultMap="AccountingDataResult">
|