@Query(value = "SELECT pl.plant_name, tpishg.plant_id, tpishg.
id AS
reg_id, tpishg.mobile_number AS shg_mob_no, "
+ "[Link] AS shg_name, [Link],tpishg.lgd_gp_nm "
+ "FROM kalpvriksh_sch.tree_plantation_info_shg AS tpishg "
+ "INNER JOIN kalpvriksh_sch.plant_list AS pl ON [Link] =
CAST(tpishg.plant_id AS int) "
+ "INNER JOIN kalpvriksh_sch.shg_user_info AS shg ON shg.mobile_no =
tpishg.mobile_number "
+ "WHERE tpishg.dist_cd = ?1 AND tpishg.teh_cd = ?2 "
+ "AND (tpishg.assigne_status IS NULL OR tpishg.assigne_status = 0) "
+ "AND tpishg.grow_plant_image IS NOT NULL", nativeQuery = true)
List<Object[]> findPlantationListByUrbunData_ru1SHG(String districtCd,
String tehCd);
@Query(value = "select * from ( \r\n"
+ " select distinct
pl.plant_name,tpi.plant_id,[Link] as reg_id,tpi.mobile_number as
citizen_mob_no,lgd_gp_nm, \r\n"
+ " [Link] as citizen_name ,
[Link] \r\n"
+ " from
kalpvriksh_sch.tree_plantation_info as tpi \r\n"
+ " inner join
kalpvriksh_sch.plant_list as pl on [Link]= CAST(tpi.plant_id AS int) \r\n"
+ " inner join
kalpvriksh_sch.citizen_user_info as cui on cui.mobile_no=tpi.mobile_number \r\n"
+ " where tpi.dist_cd=?1 and
tpi.lgd_ulb_cd is null\r\n"
+ " and (tpi.assigne_status is
null or tpi.assigne_status=0) \r\n"
+ " and tpi.grow_plant_image is
not null and lgd_gp_cd is not null ) a ORDER BY random()", nativeQuery = true)
List<Object[]> findPlantationListByDistrictCodeTehsil(@Param("districtCd")
String districtCd);